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">
<DataGrid.RowStyle>
<Style BasedOn="{StaticResource DataGridRowStyle}" TargetType="DataGridRow">
<Setter Property="Foreground" Value="White" />
<Setter Property="Foreground" Value="{StaticResource LightPrimaryBrush}" />
<Setter Property="Background" Value="#18a05d" />
<Style.Triggers>
<DataTrigger Binding="{Binding DrawingNo}" Value="">

View File

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

View File

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

View File

@ -86,14 +86,14 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI
LoadingMask.Visibility = Visibility.Visible;
ViewModel.GetMotors().ContinueWith(x =>
{
ViewModel.LoadData()
.ContinueWith(x =>
{
//ViewModel.LoadData()
// .ContinueWith(x =>
// {
this.Dispatcher.BeginInvoke(delegate ()
{
LoadingMask.Visibility = Visibility.Collapsed;
});
});
//});
});
}
@ -393,7 +393,23 @@ namespace Sinvo.EplanHpD.Plugin.WPFUI
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)