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
Hide 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
...
@@ -62,6 +62,14 @@ namespace MultiLayout
return
null
;
return
null
;
}
}
}
}
public
bool
IsErrMsgVisable
=>
!
string
.
IsNullOrEmpty
(
ErrMsg
);
/// <summary>
/// 错误信息
/// </summary>
public
string
ErrMsg
{
get
;
set
;
}
public
Action
ErrMsgClick
;
/// <summary>
/// <summary>
///
///
/// </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="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"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:MultiLayout"
mc:Ignorable="d"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800" Loaded="MainWindow_Loaded"
Title="MainWindow" Height="450" Width="800" Loaded="MainWindow_Loaded">
ShowsNavigationUI="False">
<Window.Resources>
<ResourceDictionary>
</NavigationWindow>
<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
...
@@ -23,12 +23,12 @@ namespace MultiLayout
/// <summary>
/// <summary>
/// MainWindow.xaml 的交互逻辑
/// MainWindow.xaml 的交互逻辑
/// </summary>
/// </summary>
public
partial
class
MainWindow
:
Navigation
Window
public
partial
class
MainWindow
:
Window
{
{
IUnityContainer
container
;
IUnityContainer
container
;
LoadingProgress
lp
;
LoadingProgress
lp
;
FlyLayoutManager
manager
;
FlyLayoutManager
manager
;
NavigationService
NavigationService
=>
frame
.
NavigationService
;
public
MainWindow
()
public
MainWindow
()
{
{
InitializeComponent
();
InitializeComponent
();
...
@@ -42,6 +42,7 @@ namespace MultiLayout
...
@@ -42,6 +42,7 @@ namespace MultiLayout
lp
=
new
LoadingProgress
();
lp
=
new
LoadingProgress
();
PgLoading
p
=
new
PgLoading
();
PgLoading
p
=
new
PgLoading
();
p
.
DataContext
=
lp
;
p
.
DataContext
=
lp
;
NavigationService
.
Navigate
(
p
);
NavigationService
.
Navigate
(
p
);
await
Task
.
Delay
(
1000
);
await
Task
.
Delay
(
1000
);
...
@@ -64,7 +65,9 @@ namespace MultiLayout
...
@@ -64,7 +65,9 @@ namespace MultiLayout
container
.
RegisterInstance
(
manager
);
container
.
RegisterInstance
(
manager
);
manager
.
Init
(
manager
.
Init
(
layout
,
container
,
lp
);
layout
,
container
,
lp
);
this
.
DataContext
=
manager
;
//以后的页面切换器
FlyLayoutManager
.
NavigationService
=
NavigationService
;
FlyLayoutManager
.
NavigationService
=
NavigationService
;
//---------------------------------------------------------
//---------------------------------------------------------
...
@@ -76,7 +79,7 @@ namespace MultiLayout
...
@@ -76,7 +79,7 @@ namespace MultiLayout
NavigationService
.
Navigate
(
page
);
NavigationService
.
Navigate
(
page
);
page
.
Loaded
+=
(
s
,
e1
)
=>
page
.
Loaded
+=
(
s
,
e1
)
=>
NavigationService
.
RemoveBackEntry
();
frame
.
NavigationService
.
RemoveBackEntry
();
//---------------------------------------------------------
//---------------------------------------------------------
//初始化
//初始化
...
@@ -86,5 +89,10 @@ namespace MultiLayout
...
@@ -86,5 +89,10 @@ namespace MultiLayout
//启动Poll系统
//启动Poll系统
//FObjBase.PollModule.Current.Start();
//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 @@
...
@@ -12,10 +12,10 @@
<ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Themes/Dictionary_MyStyle.xaml"/>
<ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Themes/Dictionary_MyStyle.xaml"/>
<ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Converter/Dictionary_MyConv.xaml"/>
<ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Converter/Dictionary_MyConv.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary.MergedDictionaries>
<local:UcMultiGageVmUt x:Key="
ViewModelUt" GageTag="机尾
"/>
<local:UcMultiGageVmUt x:Key="
viewModel" GageTag="机尾" IsErrMsgVisable ="True
"/>
</ResourceDictionary>
</ResourceDictionary>
</UserControl.Resources>
</UserControl.Resources>
<Grid d:DataContext="{StaticResource
ViewModelUt
}">
<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="Center" VerticalAlignment="Top"
Visibility="{Binding IsGageTagVisible,Converter={StaticResource visbilityconv}}">
Visibility="{Binding IsGageTagVisible,Converter={StaticResource visbilityconv}}">
...
@@ -23,5 +23,6 @@
...
@@ -23,5 +23,6 @@
Padding="50,10"
Padding="50,10"
Foreground="White" />
Foreground="White" />
</Border>
</Border>
</Grid>
</Grid>
</UserControl>
</UserControl>
MultiLayout/UcMultiGage/UcMultiGage.xaml.cs
View file @
a6d8d098
...
@@ -22,7 +22,7 @@ namespace MultiLayout
...
@@ -22,7 +22,7 @@ namespace MultiLayout
public
partial
class
UcMultiGage
:
UserControl
public
partial
class
UcMultiGage
:
UserControl
{
{
public
PgMultiGage
pgMultiGage
;
public
PgMultiGage
pgMultiGage
;
FlyLayoutManager
manager
;
public
UcMultiGage
()
public
UcMultiGage
()
{
{
InitializeComponent
();
InitializeComponent
();
...
@@ -30,6 +30,7 @@ namespace MultiLayout
...
@@ -30,6 +30,7 @@ namespace MultiLayout
}
}
public
void
Init
(
FlyLayoutManager
manager
)
public
void
Init
(
FlyLayoutManager
manager
)
{
{
this
.
manager
=
manager
;
this
.
DataContext
=
manager
;
this
.
DataContext
=
manager
;
NavigationService
.
Navigate
(
pgMultiGage
);
NavigationService
.
Navigate
(
pgMultiGage
);
...
...
MultiLayout/UcMultiGage/UcMultiGageVmUt.cs
View file @
a6d8d098
...
@@ -12,6 +12,8 @@ namespace MultiLayout
...
@@ -12,6 +12,8 @@ namespace MultiLayout
public
event
PropertyChangedEventHandler
PropertyChanged
;
public
event
PropertyChangedEventHandler
PropertyChanged
;
public
string
GageTag
{
get
;
set
;
}
=
"机头"
;
public
string
GageTag
{
get
;
set
;
}
=
"机头"
;
public
bool
IsGageTagVisible
{
get
;
set
;
}
=
true
;
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 @@
...
@@ -43,11 +43,14 @@
</StackPanel>
</StackPanel>
</Viewbox>
</Viewbox>
</Grid>
</Grid>
<TabControl Grid.Column="1" Name="tabControl_graph" Template="{StaticResource GraphTab}">
<TabItem Header="TEST"/>
<TabControl Grid.Column="1" Name="tabControl_graph" Template="{StaticResource GraphTab}">
<TabItem Header="TEST2"/>
<TabItem Header="TEST"/>
<TabItem Header="TEST3"/>
<TabItem Header="TEST2"/>
</TabControl>
<TabItem Header="TEST3"/>
</TabControl>
</Grid>
</Grid>
</Grid>
</Grid>
<Grid >
<Grid >
...
...
MultiLayout/UcSingleGage/UcSingleGage.xaml.cs
View file @
a6d8d098
...
@@ -38,5 +38,10 @@ namespace MultiLayout
...
@@ -38,5 +38,10 @@ namespace MultiLayout
p
.
Init
(
manager
);
p
.
Init
(
manager
);
FlyLayoutManager
.
NavigationService
.
Navigate
(
p
);
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