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
5e2479d3
Commit
5e2479d3
authored
Nov 13, 2019
by
潘栩锋
🚴
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. 添加 FLY.Thick.Base.UI windowSize绑定模板
parent
925e79d0
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
16 deletions
+44
-16
Common.cs
Project.FLY.Thick.Base/FLY.Thick.Base.UI/Common.cs
+37
-0
FLY.Thick.Base.UI.csproj
...FLY.Thick.Base/FLY.Thick.Base.UI/FLY.Thick.Base.UI.csproj
+1
-0
PgErrorAllTable.xaml.cs
...ck.Base/FLY.Thick.Base.UI/PgError/PgErrorAllTable.xaml.cs
+5
-12
PgErrorTable.xaml.cs
...Thick.Base/FLY.Thick.Base.UI/PgError/PgErrorTable.xaml.cs
+1
-4
No files found.
Project.FLY.Thick.Base/FLY.Thick.Base.UI/Common.cs
0 → 100644
View file @
5e2479d3
using
FLY.OBJComponents.Client
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Windows
;
namespace
ThickTcpUiInWindow
{
/// <summary>
/// 公共类
/// </summary>
public
static
class
Common
{
/// <summary>
/// 绑定 Application.Current.Properties["WindowSize"] 到 BufferWindow.Size
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="createWindow"></param>
public
static
void
BindingWindowSize
<
T
>(
Func
<
int
,
BufferWindow
<
T
>>
createWindow
)
{
int
windowSize
=
30
;
if
(
Application
.
Current
.
Properties
[
"WindowSize"
]
is
int
)
windowSize
=
(
int
)
Application
.
Current
.
Properties
[
"WindowSize"
];
var
window
=
createWindow
(
windowSize
);
window
.
PropertyChanged
+=
(
s
,
e
)
=>
{
if
(
e
.
PropertyName
==
"Size"
)
{
var
w
=
s
as
BufferWindow
<
T
>;
Application
.
Current
.
Properties
[
"WindowSize"
]
=
w
.
Size
;
}
};
}
}
}
Project.FLY.Thick.Base/FLY.Thick.Base.UI/FLY.Thick.Base.UI.csproj
View file @
5e2479d3
...
@@ -98,6 +98,7 @@
...
@@ -98,6 +98,7 @@
</ItemGroup>
</ItemGroup>
<ItemGroup>
<ItemGroup>
<Compile
Include=
"App.xaml.cs"
/>
<Compile
Include=
"App.xaml.cs"
/>
<Compile
Include=
"Common.cs"
/>
<Compile
Include=
"Converter\BoltNo2BoltIndexConverter.cs"
/>
<Compile
Include=
"Converter\BoltNo2BoltIndexConverter.cs"
/>
<Compile
Include=
"Converter\ControllerStateConverter.cs"
/>
<Compile
Include=
"Converter\ControllerStateConverter.cs"
/>
<Compile
Include=
"Converter\EnumToVisibilityConverter.cs"
/>
<Compile
Include=
"Converter\EnumToVisibilityConverter.cs"
/>
...
...
Project.FLY.Thick.Base/FLY.Thick.Base.UI/PgError/PgErrorAllTable.xaml.cs
View file @
5e2479d3
...
@@ -24,7 +24,6 @@ namespace ThickTcpUiInWindow
...
@@ -24,7 +24,6 @@ namespace ThickTcpUiInWindow
{
{
WarningServiceClient
mWarningService
;
WarningServiceClient
mWarningService
;
BufferWindow
<
FlyData_WarningHistory
>
mWindow
;
BufferWindow
<
FlyData_WarningHistory
>
mWindow
;
SysParam
mSysParam
;
/// <summary>
/// <summary>
///
///
...
@@ -37,23 +36,17 @@ namespace ThickTcpUiInWindow
...
@@ -37,23 +36,17 @@ namespace ThickTcpUiInWindow
/// <summary>
/// <summary>
///
///
/// </summary>
/// </summary>
/// <param name="sysParam"></param>
/// <param name="warningService"></param>
/// <param name="warningService"></param>
public
void
Init
(
public
void
Init
(
SysParam
sysParam
,
WarningServiceClient
warningService
)
WarningServiceClient
warningService
)
{
{
mSysParam
=
sysParam
;
mWarningService
=
warningService
;
mWarningService
=
warningService
;
mWindow
=
new
BufferWindow
<
FlyData_WarningHistory
>(
mWarningService
.
NewestList
,
mSysParam
.
WindowSize
);
Common
.
BindingWindowSize
((
windowSize
)
=>
mWindow
.
PropertyChanged
+=
(
s
,
e
)
=>
{
{
if
(
e
.
PropertyName
==
"Size"
)
mWindow
=
new
BufferWindow
<
FlyData_WarningHistory
>(
mWarningService
.
NewestList
,
windowSize
);
{
return
mWindow
;
mSysParam
.
WindowSize
=
mWindow
.
Size
;
});
mSysParam
.
Save
();
}
};
grid_window
.
DataContext
=
mWindow
;
grid_window
.
DataContext
=
mWindow
;
}
}
...
...
Project.FLY.Thick.Base/FLY.Thick.Base.UI/PgError/PgErrorTable.xaml.cs
View file @
5e2479d3
...
@@ -41,13 +41,11 @@ namespace ThickTcpUiInWindow
...
@@ -41,13 +41,11 @@ namespace ThickTcpUiInWindow
/// </summary>
/// </summary>
/// <param name="warningService"></param>
/// <param name="warningService"></param>
/// <param name="warningReasonWindow"></param>
/// <param name="warningReasonWindow"></param>
/// <param name="sysParam"></param>
/// <param name="flyADService"></param>
/// <param name="flyADService"></param>
/// <param name="wdIoTipType"></param>
/// <param name="wdIoTipType"></param>
public
void
Init
(
public
void
Init
(
FLY
.
OBJComponents
.
Client
.
WarningServiceClient
warningService
,
FLY
.
OBJComponents
.
Client
.
WarningServiceClient
warningService
,
FLY
.
OBJComponents
.
Client
.
BufferWindow
<
FLY
.
OBJComponents
.
Common
.
FlyData_WarningHistory
>
warningReasonWindow
,
FLY
.
OBJComponents
.
Client
.
BufferWindow
<
FLY
.
OBJComponents
.
Common
.
FlyData_WarningHistory
>
warningReasonWindow
,
SysParam
sysParam
,
FlyADServiceClient
flyADService
,
FlyADServiceClient
flyADService
,
Type
wdIoTipType
Type
wdIoTipType
)
)
...
@@ -55,7 +53,6 @@ namespace ThickTcpUiInWindow
...
@@ -55,7 +53,6 @@ namespace ThickTcpUiInWindow
this
.
wdIoTipType
=
wdIoTipType
;
this
.
wdIoTipType
=
wdIoTipType
;
mWarningService
=
warningService
;
mWarningService
=
warningService
;
mWindow
=
warningReasonWindow
;
mWindow
=
warningReasonWindow
;
mSysParam
=
sysParam
;
mFlyADService
=
flyADService
;
mFlyADService
=
flyADService
;
gridFlows
.
ItemsSource
=
mWindow
.
Record
;
gridFlows
.
ItemsSource
=
mWindow
.
Record
;
}
}
...
@@ -106,7 +103,7 @@ namespace ThickTcpUiInWindow
...
@@ -106,7 +103,7 @@ namespace ThickTcpUiInWindow
if
(
ns
!=
null
)
if
(
ns
!=
null
)
{
{
PgErrorAllTable
p
=
new
PgErrorAllTable
();
PgErrorAllTable
p
=
new
PgErrorAllTable
();
p
.
Init
(
m
SysParam
,
m
WarningService
);
p
.
Init
(
mWarningService
);
ns
.
Navigate
(
p
);
ns
.
Navigate
(
p
);
}
}
}
}
...
...
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