Commit 4a26be49 authored by 潘栩锋's avatar 潘栩锋 🚴

复制 v8 的 GraphStyle.xaml, PropertyBinding.cs

parent 5aed4f07
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:conv="clr-namespace:FLY.ControlLibrary.Converter"
>
<conv:PercentConverter x:Key="percentconv" />
<conv:VisibilityConverter x:Key="visbilityconv" />
<conv:TimeSpan2MinConverter x:Key="timespanconv"/>
<conv:TimeSpan2MinConverter x:Key="ts2minconv"/>
<conv:TimeSpan2msConverter x:Key="ts2msconv"/>
<conv:TimeSpan2SecConverter x:Key="ts2secconv"/>
<conv:TimeSpan2MinSecConverter x:Key="ts2minsecconv" />
<conv:Equals2VisibleConverter_Collapsed x:Key="e2visconv_collapsed" />
<conv:Equals2VisibleConverter x:Key="e2visconv" />
<conv:Equals2HiddenConverter x:Key="e2hiddenconv" />
<conv:Equals2CollapsedConverter x:Key="e2collapsedconv" />
<conv:Equals2BoolConverter x:Key="e2bconv"/>
<conv:BoolReverseConverter x:Key="brconv"/>
<conv:RatioConverter x:Key="ratioconv" />
<conv:RatioConverter_TimeSpan x:Key="ratioconv_ts" />
<conv:Item2IndexConverter x:Key="i2iConv"/>
<conv:Item2NoConverter x:Key="i2noConv"/>
</ResourceDictionary>
\ No newline at end of file
...@@ -145,6 +145,10 @@ ...@@ -145,6 +145,10 @@
<AppDesigner Include="Properties\" /> <AppDesigner Include="Properties\" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Page Include="Converter\Converters.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Converter\Dictionary_MyConv.xaml"> <Page Include="Converter\Dictionary_MyConv.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType> <SubType>Designer</SubType>
......
...@@ -163,29 +163,26 @@ namespace FLYAD7_OBJ_INTERFACE ...@@ -163,29 +163,26 @@ namespace FLYAD7_OBJ_INTERFACE
} }
public class Pack_DriveState : IPack public class Pack_DriveState : IPack
{ {
//当前运行指令(1B)+当前运行状态(1B)+运行模式(1B)+ systick(4B) + 命令序列码(4B) //当前运行指令(1B)+当前运行状态(1B)+运行模式(1B)
public DRIVE_MAN_ORDER order; public DRIVE_MAN_ORDER order;
public DRIVE_MAN_STATUS status; public DRIVE_MAN_STATUS status;
public byte mode; public byte mode;
public int systick;
public Int32 marker;
#region IPack 成员 #region IPack 成员
public byte[] ToBytes() public virtual byte[] ToBytes()
{ {
List<byte> buf = new List<byte>(); List<byte> buf = new List<byte>();
buf.Add((byte)order); buf.Add((byte)order);
buf.Add((byte)status); buf.Add((byte)status);
buf.Add((byte)mode); buf.Add((byte)mode);
buf.AddRange(BitConverter.GetBytes(systick));
buf.AddRange(BitConverter.GetBytes(marker));
return buf.ToArray(); return buf.ToArray();
} }
public bool TryParse(byte[] value) public virtual bool TryParse(byte[] value)
{ {
if (value.Count() < (1 + 1 + 1 + 4 + 4)) if (value.Count() < (1 + 1 + 1))
return false; return false;
int idx = 0; int idx = 0;
order = (DRIVE_MAN_ORDER)value[idx]; order = (DRIVE_MAN_ORDER)value[idx];
...@@ -194,6 +191,36 @@ namespace FLYAD7_OBJ_INTERFACE ...@@ -194,6 +191,36 @@ namespace FLYAD7_OBJ_INTERFACE
idx++; idx++;
mode = value[idx]; mode = value[idx];
idx++; idx++;
return true;
}
#endregion
}
public class Pack_DriveState_2 : Pack_DriveState
{
//当前运行指令(1B)+当前运行状态(1B)+运行模式(1B)+ systick(4B) + 命令序列码(4B)
public int systick;
public Int32 marker;
#region IPack 成员
public override byte[] ToBytes()
{
List<byte> buf = new List<byte>();
buf.AddRange(base.ToBytes());
buf.AddRange(BitConverter.GetBytes(systick));
buf.AddRange(BitConverter.GetBytes(marker));
return buf.ToArray();
}
public override bool TryParse(byte[] value)
{
if (!base.TryParse(value))
return false;
int idx = 3;
if (value.Count() < (1 + 1 + 1 + 4 + 4))
return false;
systick = BitConverter.ToInt32(value, idx); systick = BitConverter.ToInt32(value, idx);
idx += 4; idx += 4;
marker = BitConverter.ToInt32(value, idx); marker = BitConverter.ToInt32(value, idx);
...@@ -201,6 +228,21 @@ namespace FLYAD7_OBJ_INTERFACE ...@@ -201,6 +228,21 @@ namespace FLYAD7_OBJ_INTERFACE
return true; return true;
} }
public virtual bool TryParse_version(byte[] value, out int version)
{
version = 1;
if (!base.TryParse(value))
return false;
int idx = 3;
if (value.Count() < (1 + 1 + 1 + 4 + 4))
return true;
version = 2;
systick = BitConverter.ToInt32(value, idx);
idx += 4;
marker = BitConverter.ToInt32(value, idx);
idx += 4;
return true;
}
#endregion #endregion
} }
public class Pack_SyncStatus : IPack public class Pack_SyncStatus : IPack
...@@ -601,7 +643,7 @@ namespace FLYAD7_OBJ_INTERFACE ...@@ -601,7 +643,7 @@ namespace FLYAD7_OBJ_INTERFACE
} }
public override bool TryParse(byte[] value) public override bool TryParse(byte[] value)
{ {
if (value.Count() < (2+4+1)) if (value.Count() < (2 + 4 + 1))
return false; return false;
int idx = 0; int idx = 0;
idx += 2; idx += 2;
...@@ -1470,7 +1512,7 @@ namespace FLYAD7_OBJ_INTERFACE ...@@ -1470,7 +1512,7 @@ namespace FLYAD7_OBJ_INTERFACE
/// </summary> /// </summary>
/// <param name="value"></param> /// <param name="value"></param>
/// <returns></returns> /// <returns></returns>
public virtual bool TryParse(byte[] value,out int cnt) public virtual bool TryParse(byte[] value, out int cnt)
{ {
cnt = 2; cnt = 2;
int idx = 0; int idx = 0;
...@@ -1798,7 +1840,7 @@ namespace FLYAD7_OBJ_INTERFACE ...@@ -1798,7 +1840,7 @@ namespace FLYAD7_OBJ_INTERFACE
/// <returns></returns> /// <returns></returns>
public override bool TryParse(byte[] value, out int cnt) public override bool TryParse(byte[] value, out int cnt)
{ {
if (!base.TryParse(value,out cnt)) if (!base.TryParse(value, out cnt))
return false; return false;
int idx = cnt; int idx = cnt;
...@@ -1925,16 +1967,16 @@ namespace FLYAD7_OBJ_INTERFACE ...@@ -1925,16 +1967,16 @@ namespace FLYAD7_OBJ_INTERFACE
} }
public override bool TryParse(byte[] value, out int cnt) public override bool TryParse(byte[] value, out int cnt)
{ {
if (!base.TryParse(value,out cnt)) if (!base.TryParse(value, out cnt))
return false; return false;
int idx = cnt; int idx = cnt;
cnt += (4+4); cnt += (4 + 4);
if (value.Length < cnt) if (value.Length < cnt)
return false; return false;
marker = BitConverter.ToInt32(value, idx); marker = BitConverter.ToInt32(value, idx);
idx+=4; idx += 4;
systick = BitConverter.ToInt32(value, idx); systick = BitConverter.ToInt32(value, idx);
idx += 4; idx += 4;
......
...@@ -348,7 +348,10 @@ namespace FlyADBase ...@@ -348,7 +348,10 @@ namespace FlyADBase
/// 用于检测当 为IsRunning时,脉冲是否停了很久。 /// 用于检测当 为IsRunning时,脉冲是否停了很久。
/// </summary> /// </summary>
int last_position = int.MinValue; int last_position = int.MinValue;
/// <summary>
/// 脉冲不变化次数
/// </summary>
int position_no_changed_cnt = 0;
TimeSpan NoTGridTimeOut = TimeSpan.FromSeconds(60); TimeSpan NoTGridTimeOut = TimeSpan.FromSeconds(60);
...@@ -366,7 +369,8 @@ namespace FlyADBase ...@@ -366,7 +369,8 @@ namespace FlyADBase
string jsonDbPath; string jsonDbPath;
DateTime lastTimeGridTime; DateTime lastTimeGridTime;
static FlyAD7() { static FlyAD7()
{
propertyName_save = FlyAD7JsonDb.GetMemberNames(); propertyName_save = FlyAD7JsonDb.GetMemberNames();
} }
/// <summary> /// <summary>
...@@ -380,7 +384,7 @@ namespace FlyADBase ...@@ -380,7 +384,7 @@ namespace FlyADBase
void constructor() void constructor()
{ {
Now = DateTime.Now; Now = DateTime.Now;
sysTickContext.BeReseted += () => BeResetTime = DateTime.Now; //sysTickContext.BeReseted += () => BeResetTime = DateTime.Now;
this.PropertyChanged += new PropertyChangedEventHandler(FlyAD7_PropertyChanged); this.PropertyChanged += new PropertyChangedEventHandler(FlyAD7_PropertyChanged);
...@@ -456,17 +460,33 @@ namespace FlyADBase ...@@ -456,17 +460,33 @@ namespace FlyADBase
() => () =>
{ {
if (!IsConnected) if (!IsConnected)
{
position_no_changed_cnt = 0;
return; return;
}
if (DriveStatus != DRIVE_MAN_STATUS.RUNNING) if (DriveStatus != DRIVE_MAN_STATUS.RUNNING)
{
position_no_changed_cnt = 0;
return; return;
}
if (Position != last_position) if (Position != last_position)
{ {
last_position = Position; last_position = Position;
position_no_changed_cnt = 0;
return; return;
} }
position_no_changed_cnt++;
if (driveman_wait.CheckMark(TimeSpan.FromSeconds(3)))//每3秒检查一次 if (position_no_changed_cnt >= 10)
{
//连续10秒,脉冲一样
//异常
DriveStatus = DRIVE_MAN_STATUS.STOP_MANUAL;
position_no_changed_cnt = 0;
return;
}
if (driveman_wait.CheckMark(TimeSpan.FromSeconds(2)))//每2秒检查一次
{ {
driveman_wait.Mark(); driveman_wait.Mark();
CurrObjSys.GetValueEx( CurrObjSys.GetValueEx(
...@@ -593,7 +613,8 @@ namespace FlyADBase ...@@ -593,7 +613,8 @@ namespace FlyADBase
ID, ID,
FLYAD7_OBJ_INTERFACE.SYS_DATA_INTERFACE.GET_ZERO_POS); FLYAD7_OBJ_INTERFACE.SYS_DATA_INTERFACE.GET_ZERO_POS);
} }
else { else
{
//参数不保存在设备中, 保存在电脑。 //参数不保存在设备中, 保存在电脑。
//参数写入到设备。 //参数写入到设备。
NotifyPropertyChanged(nameof(MotorType)); NotifyPropertyChanged(nameof(MotorType));
...@@ -682,11 +703,12 @@ namespace FlyADBase ...@@ -682,11 +703,12 @@ namespace FlyADBase
if (IsConnected) if (IsConnected)
{ {
ConnectCnt++; ConnectCnt++;
BeResetTime = DateTime.Now;
AfterConnected(); AfterConnected();
} }
else else
{ {
isReadyContext.Reset();
DriveOrder = DRIVE_MAN_ORDER.IDLE; DriveOrder = DRIVE_MAN_ORDER.IDLE;
DriveStatus = DRIVE_MAN_STATUS.STOP; DriveStatus = DRIVE_MAN_STATUS.STOP;
} }
...@@ -777,14 +799,24 @@ namespace FlyADBase ...@@ -777,14 +799,24 @@ namespace FlyADBase
break; break;
case FLYAD7_OBJ_INTERFACE.DRIVE_MAN_INTERFACE.GET_STATE: case FLYAD7_OBJ_INTERFACE.DRIVE_MAN_INTERFACE.GET_STATE:
{ {
FLYAD7_OBJ_INTERFACE.DRIVE_MAN_INTERFACE.Pack_DriveState p = new FLYAD7_OBJ_INTERFACE.DRIVE_MAN_INTERFACE.Pack_DriveState(); int version;
if (!p.TryParse(infodata)) FLYAD7_OBJ_INTERFACE.DRIVE_MAN_INTERFACE.Pack_DriveState_2 pack = new FLYAD7_OBJ_INTERFACE.DRIVE_MAN_INTERFACE.Pack_DriveState_2();
if (!pack.TryParse_version(infodata, out version))
break; break;
DriveOrder = p.order;
DriveStatus = p.status; if (version == 1)
Marker = p.marker; {
DriveOrder = pack.order;
DriveStatus = pack.status;
}
else if (version == 2)
{
DriveOrder = pack.order;
DriveStatus = pack.status;
Marker = pack.marker;
advGetState(); advGetState();
}
isReadyContext.isReadyGetState = true; isReadyContext.isReadyGetState = true;
} }
...@@ -1444,7 +1476,7 @@ namespace FlyADBase ...@@ -1444,7 +1476,7 @@ namespace FlyADBase
/// <param name="velocity"></param> /// <param name="velocity"></param>
public void SetVelocity(UInt32 velocity) public void SetVelocity(UInt32 velocity)
{ {
SetPosParam(velocity,UInt32.MaxValue, UInt32.MaxValue, UInt32.MaxValue, UInt32.MaxValue, UInt32.MaxValue); SetPosParam(velocity, UInt32.MaxValue, UInt32.MaxValue, UInt32.MaxValue, UInt32.MaxValue, UInt32.MaxValue);
} }
/// <summary> /// <summary>
...@@ -1795,7 +1827,8 @@ namespace FlyADBase ...@@ -1795,7 +1827,8 @@ namespace FlyADBase
public int HardwareVersion = 2; public int HardwareVersion = 2;
public static string[] GetMemberNames() { public static string[] GetMemberNames()
{
var type = typeof(FlyAD7JsonDb); var type = typeof(FlyAD7JsonDb);
return type.GetMembers().Select(mi => mi.Name).ToArray(); return type.GetMembers().Select(mi => mi.Name).ToArray();
} }
...@@ -1830,6 +1863,10 @@ namespace FlyADBase ...@@ -1830,6 +1863,10 @@ namespace FlyADBase
if (dt_1st == DateTime.MinValue) if (dt_1st == DateTime.MinValue)
{ {
dt_1st = DateTime.Now; dt_1st = DateTime.Now;
//毫秒级别取整
long tick = dt_1st.Ticks % TimeSpan.TicksPerMillisecond;
dt_1st -= TimeSpan.FromTicks(tick);
systick_1st = systick; systick_1st = systick;
return dt_1st; return dt_1st;
} }
...@@ -1841,6 +1878,10 @@ namespace FlyADBase ...@@ -1841,6 +1878,10 @@ namespace FlyADBase
//被复位了 //被复位了
BeReseted?.Invoke(); BeReseted?.Invoke();
dt_1st = DateTime.Now; dt_1st = DateTime.Now;
//毫秒级别取整
long tick = dt_1st.Ticks % TimeSpan.TicksPerMillisecond;
dt_1st -= TimeSpan.FromTicks(tick);
systick_1st = systick; systick_1st = systick;
return dt_1st; return dt_1st;
} }
......
...@@ -44,7 +44,7 @@ namespace Misc ...@@ -44,7 +44,7 @@ namespace Misc
if (pi_s == null) if (pi_s == null)
return; return;
object obj = pi_s.GetValue(src,null); object obj = pi_s.GetValue(src, null);
target[index] = obj; target[index] = obj;
src.PropertyChanged += (s, e) => src.PropertyChanged += (s, e) =>
...@@ -62,7 +62,7 @@ namespace Misc ...@@ -62,7 +62,7 @@ namespace Misc
func(); func();
src.PropertyChanged += (s, e) => src.PropertyChanged += (s, e) =>
{ {
if (srcPropertyName==e.PropertyName) if (srcPropertyName == e.PropertyName)
{ {
func(); func();
} }
...@@ -79,6 +79,105 @@ namespace Misc ...@@ -79,6 +79,105 @@ namespace Misc
} }
}; };
} }
public static void SetBinding(INotifyPropertyChanged src, string srcPropertyName, object target, Action func)
{
func();
PropertyChangedEventHandler pcevent;
src.PropertyChanged += pcevent = (s, e) =>
{
if (srcPropertyName == e.PropertyName)
{
func();
}
};
if (IsMarkdownEvents)
{
if (!bindingConexts.ContainsKey(target))
{
bindingConexts.Add(target, new List<PropertyChangedEventContexts>());
}
var list = bindingConexts[target];
list.Add(new PropertyChangedEventContexts() { src = src, propertyChanged = pcevent });
}
}
public static void SetBinding(INotifyPropertyChanged src, string[] srcPropertyNames, object target, Action func)
{
func();
PropertyChangedEventHandler pcevent;
src.PropertyChanged += pcevent = (s, e) =>
{
if (srcPropertyNames.Contains(e.PropertyName))
{
func();
}
};
if (IsMarkdownEvents)
{
if (!bindingConexts.ContainsKey(target))
{
bindingConexts.Add(target, new List<PropertyChangedEventContexts>());
}
var list = bindingConexts[target];
list.Add(new PropertyChangedEventContexts() { src = src, propertyChanged = pcevent });
}
}
public class PropertyChangedEventContexts
{
public INotifyPropertyChanged src;
public PropertyChangedEventHandler propertyChanged;
}
static Dictionary<object, List<PropertyChangedEventContexts>> bindingConexts;
static bool IsMarkdownEvents = false;
/// <summary>
/// 开始记录事件
/// </summary>
public static void StartMarkdownEvents(Dictionary<object, List<PropertyChangedEventContexts>> bindingConexts)
{
IsMarkdownEvents = true;
BindingOperations.bindingConexts = bindingConexts;
}
/// <summary>
/// 停止记录事件
/// </summary>
public static void StopMarkdownEvents()
{
IsMarkdownEvents = false;
BindingOperations.bindingConexts = null;
}
/// <summary>
/// 释放事件目标对象
/// </summary>
/// <param name="src"></param>
public static void DisposeEventTargetObject(Dictionary<object, List<PropertyChangedEventContexts>> bindingConexts, object target)
{
if (!bindingConexts.ContainsKey(target))
return;
var list = bindingConexts[target];
foreach (var context in list)
{
context.src.PropertyChanged -= context.propertyChanged;
}
bindingConexts.Remove(target);
}
/// <summary>
/// 释放事件目标对象
/// </summary>
/// <param name="src"></param>
public static void DisposeEventTargetObject(Dictionary<object, List<PropertyChangedEventContexts>> bindingConexts)
{
foreach (var list in bindingConexts.Values)
{
foreach (var context in list)
{
context.src.PropertyChanged -= context.propertyChanged;
}
}
bindingConexts.Clear();
}
public static void SetBinding(INotifyPropertyChanged src, string srcPropertyName, INotifyPropertyChanged target, string targetPropertyName, BindingMode mode) public static void SetBinding(INotifyPropertyChanged src, string srcPropertyName, INotifyPropertyChanged target, string targetPropertyName, BindingMode mode)
{ {
Type type_s = src.GetType(); Type type_s = src.GetType();
...@@ -92,10 +191,11 @@ namespace Misc ...@@ -92,10 +191,11 @@ namespace Misc
{ {
case BindingMode.OneWay://src->target case BindingMode.OneWay://src->target
{ {
object obj = pi_s.GetValue(src,null); object obj = pi_s.GetValue(src, null);
pi_t.SetValue(target, obj, null); pi_t.SetValue(target, obj, null);
src.PropertyChanged += (s, e) => PropertyChangedEventHandler pcevent;
src.PropertyChanged += pcevent = (s, e) =>
{ {
if (e.PropertyName == srcPropertyName) if (e.PropertyName == srcPropertyName)
{ {
...@@ -103,13 +203,25 @@ namespace Misc ...@@ -103,13 +203,25 @@ namespace Misc
pi_t.SetValue(target, o, null); pi_t.SetValue(target, o, null);
} }
}; };
}break;
if (IsMarkdownEvents)
{
if (!bindingConexts.ContainsKey(target))
{
bindingConexts.Add(target, new List<PropertyChangedEventContexts>());
}
var list = bindingConexts[target];
list.Add(new PropertyChangedEventContexts() { src = src, propertyChanged = pcevent });
}
}
break;
case BindingMode.TwoWay://src->target then target->src case BindingMode.TwoWay://src->target then target->src
{ {
object obj = pi_s.GetValue(src,null); object obj = pi_s.GetValue(src, null);
pi_t.SetValue(target, obj, null); pi_t.SetValue(target, obj, null);
src.PropertyChanged += (s, e) => PropertyChangedEventHandler pcevent;
src.PropertyChanged += pcevent = (s, e) =>
{ {
if (e.PropertyName == srcPropertyName) if (e.PropertyName == srcPropertyName)
{ {
...@@ -118,7 +230,17 @@ namespace Misc ...@@ -118,7 +230,17 @@ namespace Misc
} }
}; };
target.PropertyChanged += (s, e) => if (IsMarkdownEvents)
{
if (!bindingConexts.ContainsKey(target))
{
bindingConexts.Add(target, new List<PropertyChangedEventContexts>());
}
var list = bindingConexts[target];
list.Add(new PropertyChangedEventContexts() { src = src, propertyChanged = pcevent });
}
target.PropertyChanged += pcevent = (s, e) =>
{ {
if (e.PropertyName == targetPropertyName) if (e.PropertyName == targetPropertyName)
{ {
...@@ -126,7 +248,18 @@ namespace Misc ...@@ -126,7 +248,18 @@ namespace Misc
pi_s.SetValue(src, o, null); pi_s.SetValue(src, o, null);
} }
}; };
}break;
if (IsMarkdownEvents)
{
if (!bindingConexts.ContainsKey(src))
{
bindingConexts.Add(src, new List<PropertyChangedEventContexts>());
}
var list = bindingConexts[src];
list.Add(new PropertyChangedEventContexts() { src = target, propertyChanged = pcevent });
}
}
break;
} }
} }
......
...@@ -5,11 +5,16 @@ ...@@ -5,11 +5,16 @@
<Application.Resources> <Application.Resources>
<ResourceDictionary> <ResourceDictionary>
<ResourceDictionary.MergedDictionaries> <ResourceDictionary.MergedDictionaries>
<!--MahApps Style-->
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" /> <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" /> <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Themes/Light.Blue.xaml" /> <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Themes/Light.Blue.xaml" />
<!--项目Style-->
<ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Themes/Styles.xaml"/>
</ResourceDictionary.MergedDictionaries> </ResourceDictionary.MergedDictionaries>
<Style TargetType="GroupBox" /> <Style TargetType="GroupBox"/>
<Style TargetType="Expander"/>
</ResourceDictionary> </ResourceDictionary>
</Application.Resources> </Application.Resources>
</Application> </Application>
...@@ -12,10 +12,9 @@ ...@@ -12,10 +12,9 @@
<Page.Resources> <Page.Resources>
<ResourceDictionary> <ResourceDictionary>
<ResourceDictionary.MergedDictionaries> <ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Themes/Dictionary_MyStyle.xaml"/> <ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Converter/Converters.xaml"/>
<ResourceDictionary Source="pack://application:,,,/FLY.Thick.Base.UI;component/Converter/Dictionary_MyConv.xaml"/>
</ResourceDictionary.MergedDictionaries> </ResourceDictionary.MergedDictionaries>
<local:PgErrorAllTableVmUt x:Key="viewModel"/> <local:PgErrorAllTableVmUt x:Key="viewModel" />
</ResourceDictionary> </ResourceDictionary>
</Page.Resources> </Page.Resources>
<Grid d:DataContext="{StaticResource viewModel}"> <Grid d:DataContext="{StaticResource viewModel}">
...@@ -93,7 +92,6 @@ ...@@ -93,7 +92,6 @@
<Style TargetType="Button" BasedOn="{StaticResource Styles.Button.Icon.Rectangle}"> <Style TargetType="Button" BasedOn="{StaticResource Styles.Button.Icon.Rectangle}">
<Style.Triggers> <Style.Triggers>
<DataTrigger Binding="{Binding IsNewest}" Value="True"> <DataTrigger Binding="{Binding IsNewest}" Value="True">
<Setter Property="Foreground" Value="Gray"/>
<Setter Property="IsEnabled" Value="False"/> <Setter Property="IsEnabled" Value="False"/>
</DataTrigger> </DataTrigger>
</Style.Triggers> </Style.Triggers>
...@@ -108,7 +106,6 @@ ...@@ -108,7 +106,6 @@
<Style TargetType="Button" BasedOn="{StaticResource Styles.Button.Icon.Rectangle}"> <Style TargetType="Button" BasedOn="{StaticResource Styles.Button.Icon.Rectangle}">
<Style.Triggers> <Style.Triggers>
<DataTrigger Binding="{Binding IsNewest}" Value="True"> <DataTrigger Binding="{Binding IsNewest}" Value="True">
<Setter Property="Foreground" Value="Gray"/>
<Setter Property="IsEnabled" Value="False"/> <Setter Property="IsEnabled" Value="False"/>
</DataTrigger> </DataTrigger>
</Style.Triggers> </Style.Triggers>
......
...@@ -7,20 +7,27 @@ ...@@ -7,20 +7,27 @@
<SolidColorBrush x:Key="TextBrush" Color="#4C4949" /> <SolidColorBrush x:Key="TextBrush" Color="#4C4949" />
<SolidColorBrush x:Key="GrayBrush1" Color="#FF727272"/> <SolidColorBrush x:Key="GrayBrush1" Color="#FF727272"/>
<SolidColorBrush x:Key="GrayBrush2" Color="#FF858484" /> <SolidColorBrush x:Key="GrayBrush2" Color="#FF858484" />
<!--在图表中描述字符串的透明背景-->
<SolidColorBrush x:Key="TextTransparentBackgroundBrush" Color="#99FFFFFF"/>
<SolidColorBrush x:Key="SemiTransparentGreyBrush2" Color="#99FFFFFF"/> <SolidColorBrush x:Key="SemiTransparentGreyBrush2" Color="#99FFFFFF"/>
<SolidColorBrush x:Key="SemiTransparentGreyBrush" Color="#99F0F0F0"/> <SolidColorBrush x:Key="SemiTransparentGreyBrush" Color="#99F0F0F0"/>
<SolidColorBrush x:Key="SemiTransparentActiveBrush" Color="#50008BE5"/> <SolidColorBrush x:Key="SemiTransparentActiveBrush" Color="#50008BE5"/>
<SolidColorBrush x:Key="WhiteBrush" Color="White"/> <SolidColorBrush x:Key="WhiteBrush" Color="White"/>
<!--尺寸--> <!--尺寸-->
<sys:Double x:Key="FontSize.Title">16</sys:Double> <sys:Double x:Key="FontSize.Title">15</sys:Double>
<sys:Double x:Key="FontSize.Value">20</sys:Double> <sys:Double x:Key="FontSize.Value">15</sys:Double>
<sys:Double x:Key="FontSize.Unit">15</sys:Double> <sys:Double x:Key="FontSize.Unit">15</sys:Double>
<Thickness x:Key="TextMargin">5,0</Thickness> <Thickness x:Key="TextMargin">2.5 0</Thickness>
<sys:Double x:Key="GraphInfoRowMaxHeight">19</sys:Double>
<sys:Double x:Key="GraphInfo2RowMaxHeight">38</sys:Double>
<!--字体--> <!--字体-->
<Style x:Key="TitleStyle" TargetType="TextBlock"> <Style x:Key="TitleStyle" TargetType="TextBlock">
<Setter Property="Padding" Value="5,2"/>
<Setter Property="Width" Value="50"/> <Setter Property="Width" Value="50"/>
<Setter Property="Foreground" Value="{StaticResource GrayBrush1}"/> <Setter Property="Foreground" Value="{StaticResource GrayBrush1}"/>
<Setter Property="FontSize" Value="{StaticResource FontSize.Title}"/> <Setter Property="FontSize" Value="{StaticResource FontSize.Title}"/>
...@@ -29,7 +36,7 @@ ...@@ -29,7 +36,7 @@
<Style x:Key="ValueStyle" TargetType="TextBlock"> <Style x:Key="ValueStyle" TargetType="TextBlock">
<Setter Property="Foreground" Value="{StaticResource TextBrush}"/> <Setter Property="Foreground" Value="{StaticResource TextBrush}"/>
<Setter Property="FontSize" Value="{StaticResource FontSize.Value}"/> <Setter Property="FontSize" Value="{StaticResource FontSize.Value}"/>
<Setter Property="Padding" Value="{StaticResource TextMargin}"/> <Setter Property="Padding" Value="5,2"/>
</Style> </Style>
<Style x:Key="UnitStyle" TargetType="TextBlock"> <Style x:Key="UnitStyle" TargetType="TextBlock">
<Setter Property="Foreground" Value="{StaticResource GrayBrush2}"/> <Setter Property="Foreground" Value="{StaticResource GrayBrush2}"/>
...@@ -38,6 +45,7 @@ ...@@ -38,6 +45,7 @@
</Style> </Style>
<!--Axis.Section--> <!--Axis.Section-->
<!--图表中选择器-->
<Style x:Key="Styles.Axis.Section.Selected" TargetType="lvc:AxisSection" > <Style x:Key="Styles.Axis.Section.Selected" TargetType="lvc:AxisSection" >
<Setter Property="StrokeThickness" Value="1"/> <Setter Property="StrokeThickness" Value="1"/>
<Setter Property="DataLabel" Value="False"/> <Setter Property="DataLabel" Value="False"/>
...@@ -47,8 +55,16 @@ ...@@ -47,8 +55,16 @@
<Setter Property="Stroke" Value="#FFCA000C"/> <Setter Property="Stroke" Value="#FFCA000C"/>
<Setter Property="Fill" Value="#59CA000C"/> <Setter Property="Fill" Value="#59CA000C"/>
<!--<Setter Property="Stroke" Value="#FFFDC8C8"/>--> </Style>
<!--<Setter Property="Fill" Value="#59F7D8D8"/>-->
<!--图表中放大用选择器-->
<Style x:Key="Styles.Axis.Section.Selected.ZoomIn" TargetType="lvc:AxisSection" >
<Setter Property="StrokeThickness" Value="1"/>
<Setter Property="DataLabel" Value="True"/>
<Setter Property="DisableAnimations" Value="True"/>
<Setter Property="DataLabelForeground" Value="White"/>
<Setter Property="Opacity" Value="0.5"/>
<Setter Property="Stroke" Value="{StaticResource MahApps.Brushes.Accent}"/>
</Style> </Style>
<!--扫描图,纵向趋势图Y轴 标签--> <!--扫描图,纵向趋势图Y轴 标签-->
......
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