105040 优化界面显示效果

This commit is contained in:
lihanbo 2024-12-05 14:15:08 +08:00
parent 01ce9d436a
commit 7bcddb1702
4 changed files with 112 additions and 80 deletions

View File

@ -227,7 +227,7 @@
VirtualizingPanel.ScrollUnit="Pixel"> VirtualizingPanel.ScrollUnit="Pixel">
<DataGrid.RowStyle> <DataGrid.RowStyle>
<Style BasedOn="{StaticResource DataGridRowStyle}" TargetType="DataGridRow"> <Style BasedOn="{StaticResource DataGridRowStyle}" TargetType="DataGridRow">
<Setter Property="Foreground" Value="White" /> <Setter Property="Foreground" Value="{StaticResource LightPrimaryBrush}" />
<Setter Property="Background" Value="#18a05d" /> <Setter Property="Background" Value="#18a05d" />
<Style.Triggers> <Style.Triggers>
<DataTrigger Binding="{Binding DrawingNo}" Value=""> <DataTrigger Binding="{Binding DrawingNo}" Value="">

View File

@ -1,4 +1,4 @@
<Window <hc:GlowWindow
x:Class="Sinvo.EplanHpD.Plugin.WPFUI.View.LayoutHelperWindow" x:Class="Sinvo.EplanHpD.Plugin.WPFUI.View.LayoutHelperWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
@ -11,6 +11,8 @@
Height="230" Height="230"
MinWidth="450" MinWidth="450"
MinHeight="230" MinHeight="230"
ActiveGlowColor="{DynamicResource PrimaryColor}"
Background="White"
mc:Ignorable="d"> mc:Ignorable="d">
<Window.Resources> <Window.Resources>
<ResourceDictionary> <ResourceDictionary>
@ -19,6 +21,7 @@
</ResourceDictionary.MergedDictionaries> </ResourceDictionary.MergedDictionaries>
</ResourceDictionary> </ResourceDictionary>
</Window.Resources> </Window.Resources>
<Border Background="{DynamicResource MainContentForegroundDrawingBrush}">
<Grid Margin="2"> <Grid Margin="2">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="15" /> <RowDefinition Height="15" />
@ -50,15 +53,18 @@
<Run Foreground="{StaticResource DangerBrush}" Text="MRJ001" /> <Run Foreground="{StaticResource DangerBrush}" Text="MRJ001" />
</TextBlock> </TextBlock>
</StackPanel> </StackPanel>
<ListView Grid.Row="2"> <ListView
Grid.Row="2"
hc:GridViewAttach.ColumnHeaderHeight="10"
Style="{StaticResource ListView.Small}">
<ListView.View> <ListView.View>
<GridView hc:GridViewAttach.ColumnHeaderHeight="15"> <GridView>
<GridViewColumn Width="100" Header="线类型" /> <GridViewColumn Width="100" Header="线类型" />
<GridViewColumn Width="100" Header="线型号" /> <GridViewColumn Width="200" Header="线型号" />
<GridViewColumn Width="100" Header="查看图纸" /> <GridViewColumn Width="50" Header="图纸" />
</GridView> </GridView>
</ListView.View> </ListView.View>
<ListViewItem Content="12312" /> <ListViewItem Content="1231211111111111111" />
</ListView> </ListView>
<hc:SimpleStackPanel Grid.Row="3"> <hc:SimpleStackPanel Grid.Row="3">
<TextBlock TextWrapping="Wrap"> <TextBlock TextWrapping="Wrap">
@ -86,4 +92,5 @@
</DockPanel> </DockPanel>
</hc:SimpleStackPanel> </hc:SimpleStackPanel>
</Grid> </Grid>
</Window> </Border>
</hc:GlowWindow>

View File

@ -184,6 +184,7 @@
x:Name="MotorListView" x:Name="MotorListView"
Padding="0" Padding="0"
HorizontalContentAlignment="Stretch" HorizontalContentAlignment="Stretch"
Focusable="True"
ItemsSource="{Binding Motors}" ItemsSource="{Binding Motors}"
ScrollViewer.CanContentScroll="False" ScrollViewer.CanContentScroll="False"
VirtualizingPanel.ScrollUnit="Pixel"> VirtualizingPanel.ScrollUnit="Pixel">
@ -191,7 +192,11 @@
<Style BasedOn="{StaticResource ListBoxItemBaseStyle}" TargetType="ListBoxItem"> <Style BasedOn="{StaticResource ListBoxItemBaseStyle}" TargetType="ListBoxItem">
<Setter Property="Padding" Value="0" /> <Setter Property="Padding" Value="0" />
<Setter Property="Margin" Value="0" /> <Setter Property="Margin" Value="0" />
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="#f5f5f5" />
</Trigger>
</Style.Triggers>
</Style> </Style>
</ListBox.ItemContainerStyle> </ListBox.ItemContainerStyle>
<ListBox.Resources> <ListBox.Resources>
@ -202,7 +207,7 @@
<Style.Triggers> <Style.Triggers>
<Trigger Property="IsExpanded" Value="True"> <Trigger Property="IsExpanded" Value="True">
<Setter Property="Foreground" Value="{StaticResource LightPrimaryBrush}" /> <Setter Property="Foreground" Value="{StaticResource PrimaryTextBrush}" />
<Setter Property="Background" Value="Transparent" /> <Setter Property="Background" Value="Transparent" />
</Trigger> </Trigger>
<DataTrigger Binding="{Binding IsError}" Value="True"> <DataTrigger Binding="{Binding IsError}" Value="True">
@ -267,6 +272,10 @@
Orientation="Horizontal"> Orientation="Horizontal">
<!-- Click="SelectedLectotype_Click" --> <!-- Click="SelectedLectotype_Click" -->
<ToggleButton Content="展开线材选型" IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource AncestorType=Expander}}" /> <ToggleButton Content="展开线材选型" IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource AncestorType=Expander}}" />
<Button
Margin="10,0,0,0"
Click="MotorListViewToMotorSourceMenuItem_Click"
Content="查看3D中电机" />
</StackPanel> </StackPanel>
</Grid> </Grid>
</Expander.Header> </Expander.Header>

View File

@ -86,14 +86,14 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI
LoadingMask.Visibility = Visibility.Visible; LoadingMask.Visibility = Visibility.Visible;
ViewModel.GetMotors().ContinueWith(x => ViewModel.GetMotors().ContinueWith(x =>
{ {
ViewModel.LoadData() //ViewModel.LoadData()
.ContinueWith(x => // .ContinueWith(x =>
{ // {
this.Dispatcher.BeginInvoke(delegate () this.Dispatcher.BeginInvoke(delegate ()
{ {
LoadingMask.Visibility = Visibility.Collapsed; LoadingMask.Visibility = Visibility.Collapsed;
}); });
}); //});
}); });
} }
@ -393,7 +393,23 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI
private void MotorListViewToMotorSourceMenuItem_Click(object sender, RoutedEventArgs e) private void MotorListViewToMotorSourceMenuItem_Click(object sender, RoutedEventArgs e)
{ {
var selectItem = MotorListView.SelectedItem;
if (selectItem is MotorModel motor)
{
var motorModelPartId = motor?.OccPartId;
//var cableName = model.IsComplexLine ? model.CableName.Split('/')[1] : model.CableName;
//if (string.IsNullOrEmpty(motorModelPartId))
//{
// FlexMessageBox.ShowText(FlexMessageBox.Type.INFO, "未获取到电机名称");
//}
//else
{
ViewModel.ToMotorSource(motorModelPartId, "");
}
//}
}
} }
private void MotorListViewToCableLectotype_Click(object sender, RoutedEventArgs e) private void MotorListViewToCableLectotype_Click(object sender, RoutedEventArgs e)