Commit 39a8c898 authored by 潘栩锋's avatar 潘栩锋 🚴

MultiLayout

1.修改 多页面布局 GageTag 位置靠左
parent 6a20c02e
...@@ -17,8 +17,9 @@ ...@@ -17,8 +17,9 @@
</Window.Resources> </Window.Resources>
<Grid d:DataContext="{StaticResource viewModel}"> <Grid d:DataContext="{StaticResource viewModel}">
<Frame Name="frame" NavigationUIVisibility="Hidden"/> <Frame Name="frame" NavigationUIVisibility="Hidden"/>
<Button Style="{StaticResource Styles.Button.Empty}" Visibility="{Binding IsErrMsgVisable,Converter={StaticResource visbilityconv}}" Click="btnErrMsgClick"> <Button Style="{StaticResource Styles.Button.Empty}" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,0,50,0"
<Border Background="Red" CornerRadius="0, 0 10 10" HorizontalAlignment="Center" VerticalAlignment="Top" > Visibility="{Binding IsErrMsgVisable,Converter={StaticResource visbilityconv}}" Click="btnErrMsgClick">
<Border Background="Red" CornerRadius="0, 0 10 10" Style="{StaticResource Styles.Shadow}">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<Grid Width="15"/> <Grid Width="15"/>
<Path Margin="5" Fill="White" Stretch="Uniform" Width="20" Height="20" SnapsToDevicePixels="True" Data="{StaticResource Geometry_alert-circle-outline}" > <Path Margin="5" Fill="White" Stretch="Uniform" Width="20" Height="20" SnapsToDevicePixels="True" Data="{StaticResource Geometry_alert-circle-outline}" >
......
using MultiLayout; using MultiLayout;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
...@@ -28,11 +29,15 @@ namespace MultiLayout ...@@ -28,11 +29,15 @@ namespace MultiLayout
IUnityContainer container; IUnityContainer container;
LoadingProgress lp; LoadingProgress lp;
FlyLayoutManager manager; FlyLayoutManager manager;
WdMainVm viewModel;
NavigationService NavigationService => frame.NavigationService; NavigationService NavigationService => frame.NavigationService;
public MainWindow() public MainWindow()
{ {
InitializeComponent(); InitializeComponent();
viewModel = new WdMainVm();
this.DataContext = viewModel;//为了隐藏报警条
} }
private async void MainWindow_Loaded(object sender, RoutedEventArgs e) private async void MainWindow_Loaded(object sender, RoutedEventArgs e)
...@@ -95,4 +100,15 @@ namespace MultiLayout ...@@ -95,4 +100,15 @@ namespace MultiLayout
manager.ErrMsgClick?.Invoke(); manager.ErrMsgClick?.Invoke();
} }
} }
public class WdMainVm:INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
public bool IsErrMsgVisable => !string.IsNullOrEmpty(ErrMsg);
/// <summary>
/// 错误信息
/// </summary>
public string ErrMsg { get; set; }
}
} }
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
</UserControl.Resources> </UserControl.Resources>
<Grid d:DataContext="{StaticResource viewModel}"> <Grid d:DataContext="{StaticResource viewModel}">
<Frame Name="frame" NavigationUIVisibility="Hidden"/> <Frame Name="frame" NavigationUIVisibility="Hidden"/>
<Border Background="#FF2C3C5A" CornerRadius="0 0 10 10" HorizontalAlignment="Center" VerticalAlignment="Top" <Border Background="#FF2C3C5A" CornerRadius="0 0 10 10" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="100,0,0,0"
Visibility="{Binding IsGageTagVisible,Converter={StaticResource visbilityconv}}"> Visibility="{Binding IsGageTagVisible,Converter={StaticResource visbilityconv}}">
<TextBlock Text="{Binding GageTag}" FontWeight="Bold" FontFamily="YouYuan" FontSize="25" <TextBlock Text="{Binding GageTag}" FontWeight="Bold" FontFamily="YouYuan" FontSize="25"
Padding="50,10" Padding="50,10"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment