Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
T
Thick-Common
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
潘栩锋
Thick-Common
Commits
a6d8d098
Commit
a6d8d098
authored
May 30, 2021
by
潘栩锋
🚴
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
multiLayout 添加 顶部报警提示栏
parent
9604a028
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
85 additions
and
17 deletions
+85
-17
FlyLayoutManager.cs
MultiLayout/FlyLayoutManager.cs
+8
-0
MainWindow.xaml
MultiLayout/MainWindow.xaml
+45
-5
MainWindow.xaml.cs
MultiLayout/MainWindow.xaml.cs
+11
-3
UcMultiGage.xaml
MultiLayout/UcMultiGage/UcMultiGage.xaml
+3
-2
UcMultiGage.xaml.cs
MultiLayout/UcMultiGage/UcMultiGage.xaml.cs
+2
-1
UcMultiGageVmUt.cs
MultiLayout/UcMultiGage/UcMultiGageVmUt.cs
+3
-1
UcSingleGage.xaml
MultiLayout/UcSingleGage/UcSingleGage.xaml
+8
-5
UcSingleGage.xaml.cs
MultiLayout/UcSingleGage/UcSingleGage.xaml.cs
+5
-0
No files found.
MultiLayout/FlyLayoutManager.cs
View file @
a6d8d098
...
...
@@ -62,6 +62,14 @@ namespace MultiLayout
return
null
;
}
}
public
bool
IsErrMsgVisable
=>
!
string
.
IsNullOrEmpty
(
ErrMsg
);
/// <summary>
/// 错误信息
/// </summary>
public
string
ErrMsg
{
get
;
set
;
}
public
Action
ErrMsgClick
;
/// <summary>
///
/// </summary>
...
...
MultiLayout/MainWindow.xaml
View file @
a6d8d098
<
Navigation
Window x:Class="MultiLayout.MainWindow"
<Window x:Class="MultiLayout.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:MultiLayout"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800" Loaded="MainWindow_Loaded"
ShowsNavigationUI="False">
</NavigationWindow>
Title="MainWindow" Height="450" Width="800" Loaded="MainWindow_Loaded">
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Themes/Dictionary_MyStyle.xaml"/>
<ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Converter/Dictionary_MyConv.xaml"/>
</ResourceDictionary.MergedDictionaries>
<local:UcMultiGageVmUt x:Key="viewModel" GageTag="机尾" IsErrMsgVisable ="True"/>
</ResourceDictionary>
</Window.Resources>
<Grid d:DataContext="{StaticResource viewModel}">
<Frame Name="frame" NavigationUIVisibility="Hidden"/>
<Button Style="{StaticResource Styles.Button.Empty}" Visibility="{Binding IsErrMsgVisable,Converter={StaticResource visbilityconv}}" Click="btnErrMsgClick">
<Border Background="Red" CornerRadius="0, 0 10 10" HorizontalAlignment="Center" VerticalAlignment="Top" >
<StackPanel Orientation="Horizontal">
<Grid Width="15"/>
<Path Margin="5" Fill="White" Stretch="Uniform" Width="20" Height="20" SnapsToDevicePixels="True" Data="{StaticResource Geometry_alert-circle-outline}" >
<Path.Style>
<Style TargetType="Path">
<Style.Triggers>
<DataTrigger Binding="{Binding IsErrMsgVisable}" Value="True">
<DataTrigger.EnterActions>
<BeginStoryboard>
<Storyboard RepeatBehavior="Forever" >
<DoubleAnimation BeginTime="0:0:0" Storyboard.TargetProperty="Opacity" From="1" To="0" Duration="00:00:01" />
<DoubleAnimation BeginTime="0:0:1" Storyboard.TargetProperty="Opacity" From="0" To="1" Duration="00:00:01" />
</Storyboard>
</BeginStoryboard>
</DataTrigger.EnterActions>
</DataTrigger>
</Style.Triggers>
</Style>
</Path.Style>
</Path>
<TextBlock Text="{Binding ErrMsg}" FontWeight="Bold" FontFamily="YouYuan" FontSize="20"
Padding="10" TextAlignment="Left" MaxWidth="600"
Foreground="White" />
<Grid Width="10"/>
</StackPanel>
</Border>
</Button>
</Grid>
</Window>
MultiLayout/MainWindow.xaml.cs
View file @
a6d8d098
...
...
@@ -23,12 +23,12 @@ namespace MultiLayout
/// <summary>
/// MainWindow.xaml 的交互逻辑
/// </summary>
public
partial
class
MainWindow
:
Navigation
Window
public
partial
class
MainWindow
:
Window
{
IUnityContainer
container
;
LoadingProgress
lp
;
FlyLayoutManager
manager
;
NavigationService
NavigationService
=>
frame
.
NavigationService
;
public
MainWindow
()
{
InitializeComponent
();
...
...
@@ -42,6 +42,7 @@ namespace MultiLayout
lp
=
new
LoadingProgress
();
PgLoading
p
=
new
PgLoading
();
p
.
DataContext
=
lp
;
NavigationService
.
Navigate
(
p
);
await
Task
.
Delay
(
1000
);
...
...
@@ -64,7 +65,9 @@ namespace MultiLayout
container
.
RegisterInstance
(
manager
);
manager
.
Init
(
layout
,
container
,
lp
);
this
.
DataContext
=
manager
;
//以后的页面切换器
FlyLayoutManager
.
NavigationService
=
NavigationService
;
//---------------------------------------------------------
...
...
@@ -76,7 +79,7 @@ namespace MultiLayout
NavigationService
.
Navigate
(
page
);
page
.
Loaded
+=
(
s
,
e1
)
=>
NavigationService
.
RemoveBackEntry
();
frame
.
NavigationService
.
RemoveBackEntry
();
//---------------------------------------------------------
//初始化
...
...
@@ -86,5 +89,10 @@ namespace MultiLayout
//启动Poll系统
//FObjBase.PollModule.Current.Start();
}
private
void
btnErrMsgClick
(
object
sender
,
RoutedEventArgs
e
)
{
manager
.
ErrMsgClick
?.
Invoke
();
}
}
}
MultiLayout/UcMultiGage/UcMultiGage.xaml
View file @
a6d8d098
...
...
@@ -12,10 +12,10 @@
<ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Themes/Dictionary_MyStyle.xaml"/>
<ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Converter/Dictionary_MyConv.xaml"/>
</ResourceDictionary.MergedDictionaries>
<local:UcMultiGageVmUt x:Key="
ViewModelUt" GageTag="机尾
"/>
<local:UcMultiGageVmUt x:Key="
viewModel" GageTag="机尾" IsErrMsgVisable ="True
"/>
</ResourceDictionary>
</UserControl.Resources>
<Grid d:DataContext="{StaticResource
ViewModelUt
}">
<Grid d:DataContext="{StaticResource
viewModel
}">
<Frame Name="frame" NavigationUIVisibility="Hidden"/>
<Border Background="#FF2C3C5A" CornerRadius="0 0 10 10" HorizontalAlignment="Center" VerticalAlignment="Top"
Visibility="{Binding IsGageTagVisible,Converter={StaticResource visbilityconv}}">
...
...
@@ -23,5 +23,6 @@
Padding="50,10"
Foreground="White" />
</Border>
</Grid>
</UserControl>
MultiLayout/UcMultiGage/UcMultiGage.xaml.cs
View file @
a6d8d098
...
...
@@ -22,7 +22,7 @@ namespace MultiLayout
public
partial
class
UcMultiGage
:
UserControl
{
public
PgMultiGage
pgMultiGage
;
FlyLayoutManager
manager
;
public
UcMultiGage
()
{
InitializeComponent
();
...
...
@@ -30,6 +30,7 @@ namespace MultiLayout
}
public
void
Init
(
FlyLayoutManager
manager
)
{
this
.
manager
=
manager
;
this
.
DataContext
=
manager
;
NavigationService
.
Navigate
(
pgMultiGage
);
...
...
MultiLayout/UcMultiGage/UcMultiGageVmUt.cs
View file @
a6d8d098
...
...
@@ -12,6 +12,8 @@ namespace MultiLayout
public
event
PropertyChangedEventHandler
PropertyChanged
;
public
string
GageTag
{
get
;
set
;
}
=
"机头"
;
public
bool
IsGageTagVisible
{
get
;
set
;
}
=
true
;
public
bool
IsErrMsgVisable
{
get
;
set
;
}
public
string
ErrMsg
{
get
;
set
;
}
=
"非常报警,包包11111111112312313131313123131312231311231312312313131"
;
}
}
MultiLayout/UcSingleGage/UcSingleGage.xaml
View file @
a6d8d098
...
...
@@ -43,11 +43,14 @@
</StackPanel>
</Viewbox>
</Grid>
<TabControl Grid.Column="1" Name="tabControl_graph" Template="{StaticResource GraphTab}">
<TabItem Header="TEST"/>
<TabItem Header="TEST2"/>
<TabItem Header="TEST3"/>
</TabControl>
</Grid>
</Grid>
<Grid >
...
...
MultiLayout/UcSingleGage/UcSingleGage.xaml.cs
View file @
a6d8d098
...
...
@@ -38,5 +38,10 @@ namespace MultiLayout
p
.
Init
(
manager
);
FlyLayoutManager
.
NavigationService
.
Navigate
(
p
);
}
private
void
btnErrMsgClick
(
object
sender
,
RoutedEventArgs
e
)
{
manager
.
ErrMsgClick
?.
Invoke
();
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment