Robert 3 years ago
parent
commit
45c4cfd880

+ 2 - 1
Bellwether/Bellwether.csproj

@@ -87,6 +87,7 @@
       <SubType>Designer</SubType>
     </ApplicationDefinition>
     <Compile Include="CustomTrigger\TouchDownTrigger.cs" />
+    <Compile Include="EdgeGestureUtil.cs" />
     <Compile Include="Pages\ucHistoryHW.xaml.cs">
       <DependentUpon>ucHistoryHW.xaml</DependentUpon>
     </Compile>
@@ -189,6 +190,7 @@
     <Content Include="DLL\Newtonsoft.Json.dll" />
     <Content Include="DLL\NLPlaneRotator.dll" />
     <Content Include="DLL\SocketTransfer.dll" />
+    <Resource Include="Images\Historywall\menu_bg_clean.png" />
     <Resource Include="Images\Historywall\button_left.png" />
     <Resource Include="Images\Historywall\button_right.png" />
     <Resource Include="Images\Historywall\menu_01.png" />
@@ -380,6 +382,5 @@
       <Name>VideoPlayer</Name>
     </ProjectReference>
   </ItemGroup>
-  <ItemGroup />
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
 </Project>

+ 261 - 0
Bellwether/EdgeGestureUtil.cs

@@ -0,0 +1,261 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Runtime.InteropServices;
+using System.Runtime.CompilerServices;
+
+namespace EdgeGesture
+{
+    public class EdgeGestureUtil
+    {
+
+        private static Guid DISABLE_TOUCH_SCREEN = new Guid("32CE38B2-2C9A-41B1-9BC5-B3784394AA44");
+        private static Guid IID_PROPERTY_STORE = new Guid("886d8eeb-8cf2-4446-8d02-cdba1dbdcf99");
+
+        private static short VT_BOOL = 11;
+        #region "Structures"
+
+        [StructLayout(LayoutKind.Sequential, Pack = 4)]
+        public struct PropertyKey
+        {
+            public PropertyKey(Guid guid, UInt32 pid)
+            {
+                fmtid = guid;
+                this.pid = pid;
+            }
+
+            [MarshalAs(UnmanagedType.Struct)]
+            public Guid fmtid;
+            public uint pid;
+        }
+
+        [StructLayout(LayoutKind.Explicit)]
+        public struct PropVariant
+        {
+            [FieldOffset(0)]
+            public short vt;
+            [FieldOffset(2)]
+            private short wReserved1;
+            [FieldOffset(4)]
+            private short wReserved2;
+            [FieldOffset(6)]
+            private short wReserved3;
+            [FieldOffset(8)]
+            private sbyte cVal;
+            [FieldOffset(8)]
+            private byte bVal;
+            [FieldOffset(8)]
+            private short iVal;
+            [FieldOffset(8)]
+            public ushort uiVal;
+            [FieldOffset(8)]
+            private int lVal;
+            [FieldOffset(8)]
+            private uint ulVal;
+            [FieldOffset(8)]
+            private int intVal;
+            [FieldOffset(8)]
+            private uint uintVal;
+            [FieldOffset(8)]
+            private long hVal;
+            [FieldOffset(8)]
+            private long uhVal;
+            [FieldOffset(8)]
+            private float fltVal;
+            [FieldOffset(8)]
+            private double dblVal;
+            [FieldOffset(8)]
+            public bool boolVal;
+            [FieldOffset(8)]
+            private int scode;
+            //CY cyVal;
+            [FieldOffset(8)]
+            private DateTime date;
+            [FieldOffset(8)]
+            private System.Runtime.InteropServices.ComTypes.FILETIME filetime;
+            //CLSID* puuid;
+            //CLIPDATA* pclipdata;
+            //BSTR bstrVal;
+            //BSTRBLOB bstrblobVal;
+            [FieldOffset(8)]
+            private Blob blobVal;
+            //LPSTR pszVal;
+            [FieldOffset(8)]
+            private IntPtr pwszVal;
+            //LPWSTR 
+            //IUnknown* punkVal;
+            //IDispatch* pdispVal;
+            //        IStream* pStream;
+            //        IStorage* pStorage;
+            //        LPVERSIONEDSTREAM pVersionedStream;
+            //        LPSAFEARRAY parray;
+            //        CAC cac;
+            //        CAUB caub;
+            //        CAI cai;
+            //        CAUI caui;
+            //        CAL cal;
+            //        CAUL caul;
+            //        CAH cah;
+            //        CAUH cauh;
+            //        CAFLT caflt;
+            //        CADBL cadbl;
+            //        CABOOL cabool;
+            //        CASCODE cascode;
+            //        CACY cacy;
+            //        CADATE cadate;
+            //        CAFILETIME cafiletime;
+            //        CACLSID cauuid;
+            //        CACLIPDATA caclipdata;
+            //        CABSTR cabstr;
+            //        CABSTRBLOB cabstrblob;
+            //        CALPSTR calpstr;
+            //        CALPWSTR calpwstr;
+            //        CAPROPVARIANT capropvar;
+            //        CHAR* pcVal;
+            //        UCHAR* pbVal;
+            //        SHORT* piVal;
+            //        USHORT* puiVal;
+            //        LONG* plVal;
+            //        ULONG* pulVal;
+            //        INT* pintVal;
+            //        UINT* puintVal;
+            //        FLOAT* pfltVal;
+            //        DOUBLE* pdblVal;
+            //        VARIANT_BOOL* pboolVal;
+            //        DECIMAL* pdecVal;
+            //        SCODE* pscode;
+            //        CY* pcyVal;
+            //        DATE* pdate;
+            //        BSTR* pbstrVal;
+            //        IUnknown** ppunkVal;
+            //        IDispatch** ppdispVal;
+            //        LPSAFEARRAY* pparray;
+            //        PROPVARIANT* pvarVal;
+            //        
+
+            /// <summary>
+            /// Helper method to gets blob data
+            /// </summary>
+            private byte[] GetBlob()
+            {
+                byte[] Result = new byte[blobVal.Length];
+                Marshal.Copy(blobVal.Data, Result, 0, Result.Length);
+                return Result;
+            }
+
+            /// <summary>
+            /// Property value
+            /// </summary>
+            public object Value
+            {
+                get
+                {
+                    VarEnum ve = (VarEnum)vt;
+                    switch (ve)
+                    {
+                        case VarEnum.VT_I1:
+                            return bVal;
+                        case VarEnum.VT_I2:
+                            return iVal;
+                        case VarEnum.VT_I4:
+                            return lVal;
+                        case VarEnum.VT_I8:
+                            return hVal;
+                        case VarEnum.VT_INT:
+                            return iVal;
+                        case VarEnum.VT_UI4:
+                            return ulVal;
+                        case VarEnum.VT_LPWSTR:
+                            return Marshal.PtrToStringUni(pwszVal);
+                        case VarEnum.VT_BLOB:
+                            return GetBlob();
+                    }
+                    throw new NotImplementedException("PropVariant " + ve.ToString());
+                }
+            }
+        }
+
+        internal struct Blob
+        {
+            public int Length;
+
+            public IntPtr Data;
+            //Code Should Compile at warning level4 without any warnings, 
+            //However this struct will give us Warning CS0649: Field [Fieldname] 
+            //is never assigned to, and will always have its default value
+            //You can disable CS0649 in the project options but that will disable
+            //the warning for the whole project, it's a nice warning and we do want 
+            //it in other places so we make a nice dummy function to keep the compiler
+            //happy.
+            private void FixCS0649()
+            {
+                Length = 0;
+                Data = IntPtr.Zero;
+            }
+        }
+
+        #endregion
+
+        #region "Interfaces"
+
+        [ComImport(), Guid("886D8EEB-8CF2-4446-8D02-CDBA1DBDCF99"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
+        public interface IPropertyStore
+        {
+            [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
+            void GetCount([Out(), In()] ref uint cProps);
+
+            [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
+            void GetAt([In()] uint iProp, ref PropertyKey pkey);
+
+            [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
+            void GetValue([In()] ref PropertyKey key, ref PropVariant pv);
+
+            [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
+            void SetValue([In()] ref PropertyKey key, [In()] ref PropVariant pv);
+
+            [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
+            void Commit();
+
+            [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
+            void Release();
+        }
+
+        #endregion
+
+        #region "Methods"
+
+        [DllImport("shell32.dll", SetLastError = true)]
+        private static extern int SHGetPropertyStoreForWindow(IntPtr handle, Guid riid, ref IPropertyStore propertyStore);
+
+        public static void EnableEdgeGestures(IntPtr hwnd, bool enable)
+        {
+            IPropertyStore pPropStore = null;
+            int hr = 0;
+            hr = SHGetPropertyStoreForWindow(hwnd, IID_PROPERTY_STORE, ref pPropStore);
+            if (hr == 0)
+            {
+                PropertyKey propKey = new PropertyKey();
+                propKey.fmtid = DISABLE_TOUCH_SCREEN;
+                propKey.pid = 2;
+                PropVariant var = new PropVariant();
+                var.vt = VT_BOOL;
+                var.boolVal = enable;
+                pPropStore.SetValue(ref propKey, ref var);
+                Marshal.FinalReleaseComObject(pPropStore);
+            }
+        }
+
+        #endregion
+
+    }
+
+    //=======================================================
+    //Service provided by Telerik (www.telerik.com)
+    //Conversion powered by NRefactory.
+    //Twitter: @telerik
+    //Facebook: facebook.com/telerik
+    //=======================================================
+
+}

BIN
Bellwether/Images/Historywall/menu_bg_clean.png


+ 4 - 0
Bellwether/MainWindow.xaml.cs

@@ -1,6 +1,7 @@
 using Bellwether.Utility;
 using System;
 using System.Collections.Generic;
+using System.Diagnostics;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
@@ -50,6 +51,9 @@ namespace Bellwether
 
         private void MainWindow_Loaded(object sender, RoutedEventArgs e)
         {
+            //Process process = Process.GetCurrentProcess();
+            //EdgeGesture.EdgeGestureUtil.EnableEdgeGestures(process.MainWindowHandle, true);
+
             uxMainGrid.Children.Add(new ucMainControlPage());
         }
 

+ 130 - 53
Bellwether/Pages/ucFrontPage.xaml

@@ -13,42 +13,109 @@
     d:DesignWidth="5760"
     mc:Ignorable="d"
     x:Class="Bellwether.Pages.ucFrontPage">
-    <UserControl.Resources>
-        <Storyboard
-            x:Key="sbSolarLight"
-            RepeatBehavior="Forever"
-            Duration="0:0:7">
-            <PointAnimation
-                Storyboard.TargetName="uxSolarEnergyLightBrush"
-                Storyboard.TargetProperty="StartPoint"
-                From="-100,-100"
-                To="1788,460"
-                Duration="0:0:1" />
-            <PointAnimation
-                Storyboard.TargetName="uxSolarEnergyLightBrush"
-                Storyboard.TargetProperty="EndPoint"
-                From="0,0"
-                To="1888,560"
-                Duration="0:0:1" />
-        </Storyboard>
-        <Storyboard
-            x:Key="sbDatetimeLight"
-            RepeatBehavior="Forever"
-            Duration="0:0:5">
-            <PointAnimation
-                Storyboard.TargetName="uxDatetimeLightBrush"
-                Storyboard.TargetProperty="StartPoint"
-                From="-50,-50"
-                To="943,230"
-                Duration="0:0:1" />
-            <PointAnimation
-                Storyboard.TargetName="uxDatetimeLightBrush"
-                Storyboard.TargetProperty="EndPoint"
-                From="0,0"
-                To="993,280"
-                Duration="0:0:1" />
-        </Storyboard>
-    </UserControl.Resources>
+    <UserControl.Resources />
+    <UserControl.Triggers>
+        <EventTrigger RoutedEvent="Loaded">
+            <BeginStoryboard>
+                <Storyboard RepeatBehavior="Forever" Duration="0:0:7">
+                    <PointAnimation
+                        Storyboard.TargetName="uxSolarEnergyLightBrush"
+                        Storyboard.TargetProperty="StartPoint"
+                        From="-100,-100"
+                        To="1788,460"
+                        Duration="0:0:1" />
+                    <PointAnimation
+                        Storyboard.TargetName="uxSolarEnergyLightBrush"
+                        Storyboard.TargetProperty="EndPoint"
+                        From="0,0"
+                        To="1888,560"
+                        Duration="0:0:1" />
+                </Storyboard>
+            </BeginStoryboard>
+            <BeginStoryboard>
+                <Storyboard RepeatBehavior="Forever" Duration="0:0:5">
+                    <PointAnimation
+                        Storyboard.TargetName="uxDatetimeLightBrush"
+                        Storyboard.TargetProperty="StartPoint"
+                        From="-50,-50"
+                        To="943,230"
+                        Duration="0:0:1" />
+                    <PointAnimation
+                        Storyboard.TargetName="uxDatetimeLightBrush"
+                        Storyboard.TargetProperty="EndPoint"
+                        From="0,0"
+                        To="993,280"
+                        Duration="0:0:1" />
+                </Storyboard>
+            </BeginStoryboard>
+            <BeginStoryboard>
+                <Storyboard RepeatBehavior="Forever">
+                    <Storyboard BeginTime="0:0:10">
+                        <DoubleAnimation
+                            BeginTime="0:0:0"
+                            Storyboard.TargetName="uxHistoryBtn"
+                            Storyboard.TargetProperty="RenderTransform.Children[1].Y"
+                            From="0"
+                            To="25"
+                            Duration="0:0:2" />
+                        <DoubleAnimation
+                            BeginTime="0:0:0.5"
+                            Storyboard.TargetName="uxProductBtn"
+                            Storyboard.TargetProperty="RenderTransform.Children[1].Y"
+                            From="0"
+                            To="25"
+                            Duration="0:0:2">
+                            <DoubleAnimation.EasingFunction>
+                                <CubicEase />
+                            </DoubleAnimation.EasingFunction>
+                        </DoubleAnimation>
+                        <DoubleAnimation
+                            BeginTime="0:0:1"
+                            Storyboard.TargetName="uxNewsBtn"
+                            Storyboard.TargetProperty="RenderTransform.Children[1].Y"
+                            From="0"
+                            To="25"
+                            Duration="0:0:2">
+                            <DoubleAnimation.EasingFunction>
+                                <CubicEase />
+                            </DoubleAnimation.EasingFunction>
+                        </DoubleAnimation>
+                    </Storyboard>
+                    <Storyboard BeginTime="0:0:20">
+                        <DoubleAnimation
+                            BeginTime="0:0:0"
+                            Storyboard.TargetName="uxHistoryBtn"
+                            Storyboard.TargetProperty="RenderTransform.Children[1].Y"
+                            From="25"
+                            To="0"
+                            Duration="0:0:2" />
+                        <DoubleAnimation
+                            BeginTime="0:0:0.5"
+                            Storyboard.TargetName="uxProductBtn"
+                            Storyboard.TargetProperty="RenderTransform.Children[1].Y"
+                            From="25"
+                            To="0"
+                            Duration="0:0:2">
+                            <DoubleAnimation.EasingFunction>
+                                <CubicEase />
+                            </DoubleAnimation.EasingFunction>
+                        </DoubleAnimation>
+                        <DoubleAnimation
+                            BeginTime="0:0:1"
+                            Storyboard.TargetName="uxNewsBtn"
+                            Storyboard.TargetProperty="RenderTransform.Children[1].Y"
+                            From="25"
+                            To="0"
+                            Duration="0:0:2">
+                            <DoubleAnimation.EasingFunction>
+                                <CubicEase />
+                            </DoubleAnimation.EasingFunction>
+                        </DoubleAnimation>
+                    </Storyboard>
+                </Storyboard>
+            </BeginStoryboard>
+        </EventTrigger>
+    </UserControl.Triggers>
     <UserControl.Content>
         <Grid>
             <Image
@@ -426,6 +493,7 @@
             </Grid>
             <Grid HorizontalAlignment="Left" VerticalAlignment="Top">
                 <Image
+                    x:Name="uxHistoryBtn"
                     Width="583"
                     Height="214"
                     Margin="2037,292,0,0"
@@ -434,33 +502,35 @@
                     MouseUp="Button_Click"
                     Source="pack://application:,,,/Bellwether;component/Images/Home_menu_01.png">
                     <Image.RenderTransform>
-                        <ScaleTransform CenterX="291" CenterY="107" ScaleX="1" />
+                        <TransformGroup>
+                            <ScaleTransform CenterX="291" CenterY="107" />
+                            <TranslateTransform />
+                        </TransformGroup>
                     </Image.RenderTransform>
                     <Image.Triggers>
                         <EventTrigger RoutedEvent="TouchDown">
                             <BeginStoryboard>
                                 <Storyboard>
                                     <DoubleAnimation
-                                        Storyboard.TargetProperty="RenderTransform.ScaleX"
+                                        Storyboard.TargetProperty="RenderTransform.Children[0].ScaleX"
                                         To="0.9"
                                         Duration="0:0:0.3" />
                                     <DoubleAnimation
-                                        Storyboard.TargetProperty="RenderTransform.ScaleY"
+                                        Storyboard.TargetProperty="RenderTransform.Children[0].ScaleY"
                                         To="0.9"
                                         Duration="0:0:0.3" />
                                 </Storyboard>
                             </BeginStoryboard>
                         </EventTrigger>
-
                         <EventTrigger RoutedEvent="TouchLeave">
                             <BeginStoryboard>
                                 <Storyboard>
                                     <DoubleAnimation
-                                        Storyboard.TargetProperty="RenderTransform.ScaleX"
+                                        Storyboard.TargetProperty="RenderTransform.Children[0].ScaleX"
                                         To="1"
                                         Duration="0:0:0.3" />
                                     <DoubleAnimation
-                                        Storyboard.TargetProperty="RenderTransform.ScaleY"
+                                        Storyboard.TargetProperty="RenderTransform.Children[0].ScaleY"
                                         To="1"
                                         Duration="0:0:0.3" />
                                 </Storyboard>
@@ -469,6 +539,7 @@
                     </Image.Triggers>
                 </Image>
                 <Image
+                    x:Name="uxProductBtn"
                     Width="583"
                     Height="214"
                     Margin="2473,469,0,0"
@@ -477,33 +548,35 @@
                     MouseUp="Button1_Click"
                     Source="pack://application:,,,/Bellwether;component/Images/Home_menu_02.png">
                     <Image.RenderTransform>
-                        <ScaleTransform CenterX="291" CenterY="107" ScaleX="1" />
+                        <TransformGroup>
+                            <ScaleTransform CenterX="291" CenterY="107" />
+                            <TranslateTransform />
+                        </TransformGroup>
                     </Image.RenderTransform>
                     <Image.Triggers>
                         <EventTrigger RoutedEvent="TouchDown">
                             <BeginStoryboard>
                                 <Storyboard>
                                     <DoubleAnimation
-                                        Storyboard.TargetProperty="RenderTransform.ScaleX"
+                                        Storyboard.TargetProperty="RenderTransform.Children[0].ScaleX"
                                         To="0.9"
                                         Duration="0:0:0.3" />
                                     <DoubleAnimation
-                                        Storyboard.TargetProperty="RenderTransform.ScaleY"
+                                        Storyboard.TargetProperty="RenderTransform.Children[0].ScaleY"
                                         To="0.9"
                                         Duration="0:0:0.3" />
                                 </Storyboard>
                             </BeginStoryboard>
                         </EventTrigger>
-
                         <EventTrigger RoutedEvent="TouchLeave">
                             <BeginStoryboard>
                                 <Storyboard>
                                     <DoubleAnimation
-                                        Storyboard.TargetProperty="RenderTransform.ScaleX"
+                                        Storyboard.TargetProperty="RenderTransform.Children[0].ScaleX"
                                         To="1"
                                         Duration="0:0:0.3" />
                                     <DoubleAnimation
-                                        Storyboard.TargetProperty="RenderTransform.ScaleY"
+                                        Storyboard.TargetProperty="RenderTransform.Children[0].ScaleY"
                                         To="1"
                                         Duration="0:0:0.3" />
                                 </Storyboard>
@@ -512,6 +585,7 @@
                     </Image.Triggers>
                 </Image>
                 <Image
+                    x:Name="uxNewsBtn"
                     Width="583"
                     Height="214"
                     Margin="3080,613,0,0"
@@ -520,18 +594,21 @@
                     MouseUp="Button2_Click"
                     Source="pack://application:,,,/Bellwether;component/Images/Home_menu_03.png">
                     <Image.RenderTransform>
-                        <ScaleTransform CenterX="291" CenterY="107" ScaleX="1" />
+                        <TransformGroup>
+                            <ScaleTransform CenterX="291" CenterY="107" />
+                            <TranslateTransform />
+                        </TransformGroup>
                     </Image.RenderTransform>
                     <Image.Triggers>
                         <EventTrigger RoutedEvent="TouchDown">
                             <BeginStoryboard>
                                 <Storyboard>
                                     <DoubleAnimation
-                                        Storyboard.TargetProperty="RenderTransform.ScaleX"
+                                        Storyboard.TargetProperty="RenderTransform.Children[0].ScaleX"
                                         To="0.9"
                                         Duration="0:0:0.3" />
                                     <DoubleAnimation
-                                        Storyboard.TargetProperty="RenderTransform.ScaleY"
+                                        Storyboard.TargetProperty="RenderTransform.Children[0].ScaleY"
                                         To="0.9"
                                         Duration="0:0:0.3" />
                                 </Storyboard>
@@ -542,11 +619,11 @@
                             <BeginStoryboard>
                                 <Storyboard>
                                     <DoubleAnimation
-                                        Storyboard.TargetProperty="RenderTransform.ScaleX"
+                                        Storyboard.TargetProperty="RenderTransform.Children[0].ScaleX"
                                         To="1"
                                         Duration="0:0:0.3" />
                                     <DoubleAnimation
-                                        Storyboard.TargetProperty="RenderTransform.ScaleY"
+                                        Storyboard.TargetProperty="RenderTransform.Children[0].ScaleY"
                                         To="1"
                                         Duration="0:0:0.3" />
                                 </Storyboard>

+ 5 - 5
Bellwether/Pages/ucFrontPage.xaml.cs

@@ -28,12 +28,12 @@ namespace Bellwether.Pages
         {
             InitializeComponent();
 
-            var sbTimerPanelEffect = FindResource("sbSolarLight") as Storyboard;
-            var sbDatetimePanelEffectt = FindResource("sbDatetimeLight") as Storyboard;
-            sbTimerPanelEffect.Begin();
-            sbDatetimePanelEffectt.Begin();
+            //var sbTimerPanelEffect = FindResource("sbSolarLight") as Storyboard;
+            //var sbDatetimePanelEffectt = FindResource("sbDatetimeLight") as Storyboard;
+            //sbTimerPanelEffect.Begin();
+            //sbDatetimePanelEffectt.Begin();
 
-            SolarInfpoUpdateTimer = new Timer() { Interval = 60_000 };
+            SolarInfpoUpdateTimer = new Timer() { Interval = 300_000 };
             DateTimeUpdateTimer = new Timer() { Interval = 60_000 };
 
             Loaded += UcFrontPage_Load;

+ 1 - 1
Bellwether/app.manifest

@@ -16,7 +16,7 @@
             Remove this element if your application requires this virtualization for backwards
             compatibility.
         -->
-        <requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
+        <requestedExecutionLevel level="asInvoker" uiAccess="false" />
       </requestedPrivileges>
     </security>
   </trustInfo>

+ 1 - 1
BellwetherBackend/MainWindow.xaml

@@ -44,7 +44,7 @@
                     Style="{StaticResource uxTopRadioButton}" />
                 <RadioButton
                     Checked="RadioButton_Checked"
-                    Content="社會責任"
+                    Content="最新消息"
                     Style="{StaticResource uxTopRadioButton}" />
                 <RadioButton
                     Checked="RadioButton_Checked"

+ 2 - 0
BellwetherBackend/SubPage/UcFrontPage.xaml.cs

@@ -100,6 +100,8 @@ namespace BellwetherBackend.SubPage
             frontPageJson = Setting.frontPageJsonFile;
 
             uxSolarEnergyUrlText.Text = frontPageJson.SolarEnergyUrl;
+
+            uxAutoPlaIntervalText.Text = frontPageJson.AutoPlayIntervalSec.ToString();
         }
 
         private void SaveData()

+ 261 - 0
EdgeGesture/Class1.cs

@@ -0,0 +1,261 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Diagnostics;
+using System.Runtime.InteropServices;
+using System.Runtime.CompilerServices;
+
+namespace EdgeGesture
+{
+    public class EdgeGestureUtil
+    {
+
+        private static Guid DISABLE_TOUCH_SCREEN = new Guid("32CE38B2-2C9A-41B1-9BC5-B3784394AA44");
+        private static Guid IID_PROPERTY_STORE = new Guid("886d8eeb-8cf2-4446-8d02-cdba1dbdcf99");
+
+        private static short VT_BOOL = 11;
+        #region "Structures"
+
+        [StructLayout(LayoutKind.Sequential, Pack = 4)]
+        public struct PropertyKey
+        {
+            public PropertyKey(Guid guid, UInt32 pid)
+            {
+                fmtid = guid;
+                this.pid = pid;
+            }
+
+            [MarshalAs(UnmanagedType.Struct)]
+            public Guid fmtid;
+            public uint pid;
+        }
+
+        [StructLayout(LayoutKind.Explicit)]
+        public struct PropVariant
+        {
+            [FieldOffset(0)]
+            public short vt;
+            [FieldOffset(2)]
+            private short wReserved1;
+            [FieldOffset(4)]
+            private short wReserved2;
+            [FieldOffset(6)]
+            private short wReserved3;
+            [FieldOffset(8)]
+            private sbyte cVal;
+            [FieldOffset(8)]
+            private byte bVal;
+            [FieldOffset(8)]
+            private short iVal;
+            [FieldOffset(8)]
+            public ushort uiVal;
+            [FieldOffset(8)]
+            private int lVal;
+            [FieldOffset(8)]
+            private uint ulVal;
+            [FieldOffset(8)]
+            private int intVal;
+            [FieldOffset(8)]
+            private uint uintVal;
+            [FieldOffset(8)]
+            private long hVal;
+            [FieldOffset(8)]
+            private long uhVal;
+            [FieldOffset(8)]
+            private float fltVal;
+            [FieldOffset(8)]
+            private double dblVal;
+            [FieldOffset(8)]
+            public bool boolVal;
+            [FieldOffset(8)]
+            private int scode;
+            //CY cyVal;
+            [FieldOffset(8)]
+            private DateTime date;
+            [FieldOffset(8)]
+            private System.Runtime.InteropServices.ComTypes.FILETIME filetime;
+            //CLSID* puuid;
+            //CLIPDATA* pclipdata;
+            //BSTR bstrVal;
+            //BSTRBLOB bstrblobVal;
+            [FieldOffset(8)]
+            private Blob blobVal;
+            //LPSTR pszVal;
+            [FieldOffset(8)]
+            private IntPtr pwszVal;
+            //LPWSTR 
+            //IUnknown* punkVal;
+            //IDispatch* pdispVal;
+            //        IStream* pStream;
+            //        IStorage* pStorage;
+            //        LPVERSIONEDSTREAM pVersionedStream;
+            //        LPSAFEARRAY parray;
+            //        CAC cac;
+            //        CAUB caub;
+            //        CAI cai;
+            //        CAUI caui;
+            //        CAL cal;
+            //        CAUL caul;
+            //        CAH cah;
+            //        CAUH cauh;
+            //        CAFLT caflt;
+            //        CADBL cadbl;
+            //        CABOOL cabool;
+            //        CASCODE cascode;
+            //        CACY cacy;
+            //        CADATE cadate;
+            //        CAFILETIME cafiletime;
+            //        CACLSID cauuid;
+            //        CACLIPDATA caclipdata;
+            //        CABSTR cabstr;
+            //        CABSTRBLOB cabstrblob;
+            //        CALPSTR calpstr;
+            //        CALPWSTR calpwstr;
+            //        CAPROPVARIANT capropvar;
+            //        CHAR* pcVal;
+            //        UCHAR* pbVal;
+            //        SHORT* piVal;
+            //        USHORT* puiVal;
+            //        LONG* plVal;
+            //        ULONG* pulVal;
+            //        INT* pintVal;
+            //        UINT* puintVal;
+            //        FLOAT* pfltVal;
+            //        DOUBLE* pdblVal;
+            //        VARIANT_BOOL* pboolVal;
+            //        DECIMAL* pdecVal;
+            //        SCODE* pscode;
+            //        CY* pcyVal;
+            //        DATE* pdate;
+            //        BSTR* pbstrVal;
+            //        IUnknown** ppunkVal;
+            //        IDispatch** ppdispVal;
+            //        LPSAFEARRAY* pparray;
+            //        PROPVARIANT* pvarVal;
+            //        
+
+            /// <summary>
+            /// Helper method to gets blob data
+            /// </summary>
+            private byte[] GetBlob()
+            {
+                byte[] Result = new byte[blobVal.Length];
+                Marshal.Copy(blobVal.Data, Result, 0, Result.Length);
+                return Result;
+            }
+
+            /// <summary>
+            /// Property value
+            /// </summary>
+            public object Value
+            {
+                get
+                {
+                    VarEnum ve = (VarEnum)vt;
+                    switch (ve)
+                    {
+                        case VarEnum.VT_I1:
+                            return bVal;
+                        case VarEnum.VT_I2:
+                            return iVal;
+                        case VarEnum.VT_I4:
+                            return lVal;
+                        case VarEnum.VT_I8:
+                            return hVal;
+                        case VarEnum.VT_INT:
+                            return iVal;
+                        case VarEnum.VT_UI4:
+                            return ulVal;
+                        case VarEnum.VT_LPWSTR:
+                            return Marshal.PtrToStringUni(pwszVal);
+                        case VarEnum.VT_BLOB:
+                            return GetBlob();
+                    }
+                    throw new NotImplementedException("PropVariant " + ve.ToString());
+                }
+            }
+        }
+
+        internal struct Blob
+        {
+            public int Length;
+
+            public IntPtr Data;
+            //Code Should Compile at warning level4 without any warnings, 
+            //However this struct will give us Warning CS0649: Field [Fieldname] 
+            //is never assigned to, and will always have its default value
+            //You can disable CS0649 in the project options but that will disable
+            //the warning for the whole project, it's a nice warning and we do want 
+            //it in other places so we make a nice dummy function to keep the compiler
+            //happy.
+            private void FixCS0649()
+            {
+                Length = 0;
+                Data = IntPtr.Zero;
+            }
+        }
+
+        #endregion
+
+        #region "Interfaces"
+
+        [ComImport(), Guid("886D8EEB-8CF2-4446-8D02-CDBA1DBDCF99"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
+        public interface IPropertyStore
+        {
+            [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
+            void GetCount([Out(), In()] ref uint cProps);
+
+            [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
+            void GetAt([In()] uint iProp, ref PropertyKey pkey);
+
+            [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
+            void GetValue([In()] ref PropertyKey key, ref PropVariant pv);
+
+            [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
+            void SetValue([In()] ref PropertyKey key, [In()] ref PropVariant pv);
+
+            [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
+            void Commit();
+
+            [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
+            void Release();
+        }
+
+        #endregion
+
+        #region "Methods"
+
+        [DllImport("shell32.dll", SetLastError = true)]
+        private static extern int SHGetPropertyStoreForWindow(IntPtr handle, Guid riid, ref IPropertyStore propertyStore);
+
+        public static void EnableEdgeGestures(IntPtr hwnd, bool enable)
+        {
+            IPropertyStore pPropStore = null;
+            int hr = 0;
+            hr = SHGetPropertyStoreForWindow(hwnd, IID_PROPERTY_STORE, ref pPropStore);
+            if (hr == 0)
+            {
+                PropertyKey propKey = new PropertyKey();
+                propKey.fmtid = DISABLE_TOUCH_SCREEN;
+                propKey.pid = 2;
+                PropVariant var = new PropVariant();
+                var.vt = VT_BOOL;
+                var.boolVal = enable;
+                pPropStore.SetValue(ref propKey, ref var);
+                Marshal.FinalReleaseComObject(pPropStore);
+            }
+        }
+
+        #endregion
+
+    }
+
+    //=======================================================
+    //Service provided by Telerik (www.telerik.com)
+    //Conversion powered by NRefactory.
+    //Twitter: @telerik
+    //Facebook: facebook.com/telerik
+    //=======================================================
+}

+ 54 - 0
EdgeGesture/EdgeGesture.csproj

@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>2c9cb36f-6218-4753-800d-4cdeeaee2d06</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>EdgeGesture</RootNamespace>
+    <AssemblyName>EdgeGesture</AssemblyName>
+    <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <Deterministic>true</Deterministic>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System"/>
+    
+    <Reference Include="System.Core"/>
+    <Reference Include="System.Xml.Linq"/>
+    <Reference Include="System.Data.DataSetExtensions"/>
+    
+    
+    <Reference Include="Microsoft.CSharp"/>
+    
+    <Reference Include="System.Data"/>
+    
+    <Reference Include="System.Net.Http"/>
+    
+    <Reference Include="System.Xml"/>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Class1.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ </Project>

+ 36 - 0
EdgeGesture/Properties/AssemblyInfo.cs

@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("EdgeGesture")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("EdgeGesture")]
+[assembly: AssemblyCopyright("Copyright ©  2022")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components.  If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("2c9cb36f-6218-4753-800d-4cdeeaee2d06")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]

+ 141 - 53
HistoryDLL/DetailViewer.xaml

@@ -1,82 +1,170 @@
-<UserControl x:Class="HistoryDLL.DetailViewer"
-             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
-             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
-             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
-             xmlns:local="clr-namespace:HistoryDLL"
-             mc:Ignorable="d" Width="810" Height="535" Background="Transparent">
+<UserControl
+    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:local="clr-namespace:HistoryDLL"
+    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+    Width="810"
+    Height="535"
+    Background="Transparent"
+    mc:Ignorable="d"
+    x:Class="HistoryDLL.DetailViewer">
     <UserControl.Resources>
         <Storyboard x:Key="sbShowStart">
-            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="uxRootGrid">
-                <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="1"/>
+            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="uxRootGrid" Storyboard.TargetProperty="(UIElement.Opacity)">
+                <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="1" />
             </DoubleAnimationUsingKeyFrames>
         </Storyboard>
         <Storyboard x:Key="sbShowStop">
-            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="uxRootGrid">
-                <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="0"/>
+            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="uxRootGrid" Storyboard.TargetProperty="(UIElement.Opacity)">
+                <EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="0" />
             </DoubleAnimationUsingKeyFrames>
         </Storyboard>
     </UserControl.Resources>
     <Grid x:Name="uxDetailviewerGd">
         <Grid.RowDefinitions>
-            <RowDefinition x:Name="uxFirstLayer1" Height="20"/>
-            <RowDefinition Height="*"/>
-            <RowDefinition x:Name="uxFirstLayer2" Height="30"/>
-            <RowDefinition x:Name="uxFirstLayer3" Height="85"/>
-            <RowDefinition x:Name="uxFirstLayer4" Height="60"/>
+            <RowDefinition x:Name="uxFirstLayer1" Height="20" />
+            <RowDefinition Height="*" />
+            <RowDefinition x:Name="uxFirstLayer2" Height="30" />
+            <RowDefinition x:Name="uxFirstLayer3" Height="85" />
+            <RowDefinition x:Name="uxFirstLayer4" Height="60" />
         </Grid.RowDefinitions>
         <Grid Grid.Row="1">
             <Grid.ColumnDefinitions>
-                <ColumnDefinition x:Name="uxTopLayer1" Width="20"/>
-                <ColumnDefinition Width="*"/>
-                <ColumnDefinition x:Name="uxTopLayer2" Width="20"/>
-                <ColumnDefinition x:Name="uxTopLayer3" Width="275"/>
-                <ColumnDefinition x:Name="uxTopLayer4" Width="20"/>
+                <ColumnDefinition x:Name="uxTopLayer1" Width="20" />
+                <ColumnDefinition Width="*" />
+                <ColumnDefinition x:Name="uxTopLayer2" Width="20" />
+                <ColumnDefinition x:Name="uxTopLayer3" Width="275" />
+                <ColumnDefinition x:Name="uxTopLayer4" Width="20" />
             </Grid.ColumnDefinitions>
-            <!--大圖-->
+            <!--  大圖  -->
             <Grid Grid.Column="1">
                 <Grid.RowDefinitions>
-                    <RowDefinition x:Name="uxImgLayer" Height="310"/>
-                    <RowDefinition Height="*"/>
+                    <RowDefinition x:Name="uxImgLayer" Height="310" />
+                    <RowDefinition Height="*" />
                 </Grid.RowDefinitions>
-                <Grid Grid.Row="0" x:Name="uxMainMediaShowGd" VirtualizingPanel.VirtualizationMode="Recycling" VirtualizingPanel.IsContainerVirtualizable="True"
-                    VirtualizingPanel.IsVirtualizing="True" VirtualizingPanel.ScrollUnit="Item" >
-                </Grid>
+                <Grid
+                    x:Name="uxMainMediaShowGd"
+                    Grid.Row="0"
+                    VirtualizingPanel.IsContainerVirtualizable="True"
+                    VirtualizingPanel.IsVirtualizing="True"
+                    VirtualizingPanel.ScrollUnit="Item"
+                    VirtualizingPanel.VirtualizationMode="Recycling" />
 
-                <StackPanel x:Name="uxImgTagList" Orientation="Horizontal" Grid.Row="1" HorizontalAlignment="Center" Background="Transparent">
-                </StackPanel>
+                <StackPanel
+                    x:Name="uxImgTagList"
+                    Grid.Row="1"
+                    HorizontalAlignment="Center"
+                    Background="Transparent"
+                    Orientation="Horizontal" />
             </Grid>
-            <!--文字-->
-            <StackPanel x:Name="uxTextblockContainer" Grid.Column="3" Orientation="Vertical">
-                <TextBlock Name="uxTitleText" Width="275" TextAlignment="Left" FontSize="26" TextTrimming="CharacterEllipsis" TextWrapping="Wrap" MaxHeight="130"
-                         Foreground="WhiteSmoke" Background="Transparent" Focusable="False" Cursor="None" />
-                <ScrollViewer x:Name="uxStrMainScroll" VerticalScrollBarVisibility="Hidden" BorderThickness="0" HorizontalScrollBarVisibility="Hidden" Height="307"
-                              Background="Transparent" PanningMode="VerticalOnly" PanningDeceleration="0.005" ManipulationBoundaryFeedback="uxBoundGrid_ManipulationBoundaryFeedback">
-                    <StackPanel Name="uxTxtStackPanel" Orientation="Vertical" >
-                        <TextBlock Name="uxDateText" Width="275" FontSize="22" TextWrapping="Wrap" Foreground="WhiteSmoke" Background="Transparent" />
-                        <TextBlock Name="uxContentText" Width="275" TextAlignment="Left" FontSize="22" Foreground="WhiteSmoke" 
-                             Background="Transparent" TextWrapping="Wrap" HorizontalAlignment="Left" VerticalAlignment="Top" />
+            <!--  文字  -->
+            <StackPanel
+                x:Name="uxTextblockContainer"
+                Grid.Column="3"
+                Orientation="Vertical">
+                <TextBlock
+                    Name="uxTitleText"
+                    Width="275"
+                    MaxHeight="130"
+                    FontSize="26"
+                    Background="Transparent"
+                    Cursor="None"
+                    Focusable="False"
+                    Foreground="WhiteSmoke"
+                    TextAlignment="Left"
+                    TextTrimming="CharacterEllipsis"
+                    TextWrapping="Wrap" />
+                <ScrollViewer
+                    x:Name="uxStrMainScroll"
+                    Height="307"
+                    Background="Transparent"
+                    BorderThickness="0"
+                    HorizontalScrollBarVisibility="Hidden"
+                    ManipulationBoundaryFeedback="uxBoundGrid_ManipulationBoundaryFeedback"
+                    PanningDeceleration="0.005"
+                    PanningMode="VerticalOnly"
+                    VerticalScrollBarVisibility="Hidden">
+                    <StackPanel Name="uxTxtStackPanel" Orientation="Vertical">
+                        <TextBlock
+                            Name="uxDateText"
+                            Width="275"
+                            FontSize="22"
+                            Background="Transparent"
+                            Foreground="WhiteSmoke"
+                            TextWrapping="Wrap" />
+                        <TextBlock
+                            Name="uxContentText"
+                            Width="275"
+                            HorizontalAlignment="Left"
+                            VerticalAlignment="Top"
+                            FontSize="22"
+                            Background="Transparent"
+                            Foreground="WhiteSmoke"
+                            TextAlignment="Left"
+                            TextWrapping="Wrap" />
                     </StackPanel>
                 </ScrollViewer>
             </StackPanel>
         </Grid>
 
-        <Grid Grid.Row="3" x:Name="uxGalleryGd" Background="Transparent" Margin="20,0,20,0">
-        </Grid>
+        <Grid
+            x:Name="uxGalleryGd"
+            Grid.Row="3"
+            Margin="20,0,20,0"
+            Background="Transparent" />
 
-        <StackPanel Grid.Row="4" Orientation="Horizontal" HorizontalAlignment="Right">
-            <!--Width="96"-->
-            <RadioButton x:Name="uxLan0" FontSize="16" Width="96" Height="35" Tag="0" Style="{DynamicResource uxdetailViewerLanBtn}" Margin="0,0,10,0"
-                         Checked="uxLan_Checked"/>
-            <RadioButton x:Name="uxLan1" FontSize="16" Width="96" Height="35" Tag="1" Style="{DynamicResource uxdetailViewerLanBtn}" Margin="0,0,10,0"
-                         Checked="uxLan_Checked"/>
-            <RadioButton x:Name="uxLan2" FontSize="16" Width="0" Height="35" Tag="2" Style="{DynamicResource uxdetailViewerLanBtn}" Margin="0,0,10,0"
-                         Checked="uxLan_Checked"/>
-            <RadioButton x:Name="uxLan3" FontSize="16" Width="0" Height="35" Tag="3" Style="{DynamicResource uxdetailViewerLanBtn}" Margin="0,0,10,0"
-                         Checked="uxLan_Checked"/>
+        <StackPanel
+            Grid.Row="4"
+            HorizontalAlignment="Right"
+            Orientation="Horizontal">
+            <!--  Width="96"  -->
+            <RadioButton
+                x:Name="uxLan0"
+                Width="0"
+                Height="35"
+                Margin="0,0,10,0"
+                FontSize="16"
+                Checked="uxLan_Checked"
+                Style="{DynamicResource uxdetailViewerLanBtn}"
+                Tag="0" />
+            <RadioButton
+                x:Name="uxLan1"
+                Width="0"
+                Height="35"
+                Margin="0,0,10,0"
+                FontSize="16"
+                Checked="uxLan_Checked"
+                Style="{DynamicResource uxdetailViewerLanBtn}"
+                Tag="1" />
+            <RadioButton
+                x:Name="uxLan2"
+                Width="0"
+                Height="35"
+                Margin="0,0,10,0"
+                FontSize="16"
+                Checked="uxLan_Checked"
+                Style="{DynamicResource uxdetailViewerLanBtn}"
+                Tag="2" />
+            <RadioButton
+                x:Name="uxLan3"
+                Width="0"
+                Height="35"
+                Margin="0,0,10,0"
+                FontSize="16"
+                Checked="uxLan_Checked"
+                Style="{DynamicResource uxdetailViewerLanBtn}"
+                Tag="3" />
 
-            <Button x:Name="uxExitBtn" Content="X" Style="{DynamicResource detailViewerCloseButton}" Width="35" Height="35" Margin="0,0,10,0" FontSize="16"
-                    Click="uxCloseBtn_Click"></Button>
+            <Button
+                x:Name="uxExitBtn"
+                Width="35"
+                Height="35"
+                Margin="0,0,10,0"
+                FontSize="16"
+                Click="uxCloseBtn_Click"
+                Content="X"
+                Style="{DynamicResource detailViewerCloseButton}" />
         </StackPanel>
     </Grid>
 </UserControl>

+ 155 - 71
HistoryWallEditTool/HistoryWallEditTool/HistoryWall.xaml

@@ -1,21 +1,25 @@
-<UserControl x:Class="HistoryWallEditTool.HistoryWall"
-        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:HistoryWallEditTool"
-        xmlns:mui="http://firstfloorsoftware.com/ModernUI"
-        x:Name="uxMainWindow" 
-        MouseDown="uxMainWindow_MouseDown"
-        MouseUp="uxMainWindow_MouseUp" >
-    
-        <Grid Width="1920" >
-            <Grid>
-                <Grid.RowDefinitions>
-                    <RowDefinition Height="101*"/>
-                    <RowDefinition Height="34*"/>
-                </Grid.RowDefinitions>
-            <Grid Width="1920" Margin="0,10,0,-10" Grid.RowSpan="2">
+<UserControl
+    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:local="clr-namespace:HistoryWallEditTool"
+    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+    xmlns:mui="http://firstfloorsoftware.com/ModernUI"
+    x:Name="uxMainWindow"
+    MouseDown="uxMainWindow_MouseDown"
+    MouseUp="uxMainWindow_MouseUp"
+    x:Class="HistoryWallEditTool.HistoryWall">
+
+    <Grid Width="1920">
+        <Grid>
+            <Grid.RowDefinitions>
+                <RowDefinition Height="101*" />
+                <RowDefinition Height="34*" />
+            </Grid.RowDefinitions>
+            <Grid
+                Grid.RowSpan="2"
+                Width="1920"
+                Margin="0,10,0,-10">
                 <Grid.RowDefinitions>
                     <RowDefinition Height="104*" />
                     <RowDefinition Height="844*" />
@@ -26,82 +30,162 @@
                 </Grid.Background>
 
                 <Grid Grid.Row="0" VerticalAlignment="Center">
-                    <RadioButton x:Name="uxDisplaySettingBtn" Width="238" Height="65" 
-                             Content="{DynamicResource displaysetting}" Style="{StaticResource uxTopRadioButton}" 
-                             VerticalAlignment="Top" HorizontalAlignment="Left" Margin="660,10,0,0" 
-                             Checked="uxDisplaySettingBtn_Checked"/>
-                    <RadioButton x:Name="uxDataSettingBtn" Width="238" Height="65" 
-                             Content="{DynamicResource datasetting}" 
-                             Style="{StaticResource uxTopRadioButton}" 
-                             VerticalAlignment="Top" HorizontalAlignment="Left" Margin="920,10,0,0"
-                             Checked="uxDataSettingBtn_Checked" />
-                    <RadioButton x:Name="uxLaunchBtn" Width="238" Height="65" Content="{DynamicResource launchhistorywall}"  
-                             Style="{StaticResource uxTopRadioButton}" Visibility="Collapsed"
-                             VerticalAlignment="Top" HorizontalAlignment="Left" Margin="1050,10,0,0" 
-                             Checked="uxLaunchBtn_Checked" />
+                    <RadioButton
+                        x:Name="uxDisplaySettingBtn"
+                        Width="238"
+                        Height="65"
+                        Margin="660,10,0,0"
+                        HorizontalAlignment="Left"
+                        VerticalAlignment="Top"
+                        Checked="uxDisplaySettingBtn_Checked"
+                        Content="{DynamicResource displaysetting}"
+                        Style="{StaticResource uxTopRadioButton}" />
+                    <RadioButton
+                        x:Name="uxDataSettingBtn"
+                        Width="238"
+                        Height="65"
+                        Margin="920,10,0,0"
+                        HorizontalAlignment="Left"
+                        VerticalAlignment="Top"
+                        Checked="uxDataSettingBtn_Checked"
+                        Content="{DynamicResource datasetting}"
+                        Style="{StaticResource uxTopRadioButton}" />
+                    <RadioButton
+                        x:Name="uxLaunchBtn"
+                        Width="238"
+                        Height="65"
+                        Margin="1050,10,0,0"
+                        HorizontalAlignment="Left"
+                        VerticalAlignment="Top"
+                        Checked="uxLaunchBtn_Checked"
+                        Content="{DynamicResource launchhistorywall}"
+                        Style="{StaticResource uxTopRadioButton}"
+                        Visibility="Collapsed" />
 
-                    <!--切換時間軸與分類軸-->
+                    <!--  切換時間軸與分類軸  -->
                     <!--<StackPanel VerticalAlignment="Top" HorizontalAlignment="Left" Orientation="Vertical" Width="100" Height="60" Margin="1300,34,0,0">
-                    <RadioButton x:Name="uxTimelineChk" Tag="TimeLine" Checked="uxlineChk_Checked" Height="26" 
-                                 Content="{DynamicResource timeline}" Style="{StaticResource uxTimelineRadioButton}" VerticalAlignment="Top" 
+                    <RadioButton x:Name="uxTimelineChk" Tag="TimeLine" Checked="uxlineChk_Checked" Height="26"
+                                 Content="{DynamicResource timeline}" Style="{StaticResource uxTimelineRadioButton}" VerticalAlignment="Top"
                                  HorizontalAlignment="Left" Margin="0,2,0,5" />
-                    <RadioButton x:Name="uxClasslineChk" Tag="ClassLine" Checked="uxlineChk_Checked" Height="26" 
-                                 Content="{DynamicResource classline}" Style="{StaticResource uxTimelineRadioButton}" VerticalAlignment="Top" 
+                    <RadioButton x:Name="uxClasslineChk" Tag="ClassLine" Checked="uxlineChk_Checked" Height="26"
+                                 Content="{DynamicResource classline}" Style="{StaticResource uxTimelineRadioButton}" VerticalAlignment="Top"
                                  HorizontalAlignment="Left" />
                 </StackPanel>-->
-                    <!--切換時間軸與分類軸 end-->
+                    <!--  切換時間軸與分類軸 end  -->
 
-                    <!--視窗關閉與最小化-->
+                    <!--  視窗關閉與最小化  -->
                     <!--
                     <Button x:Name="uxWinCloseBtn" Style="{StaticResource uxWindow_Close}" Width="50" Height="50" Margin="1810,38,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" ToolTip="{DynamicResource winclose}"  Click="uxWinCloseBtn_Click"></Button>
                     <Button x:Name="uxWinMiniBtn" Style="{StaticResource uxWindow_Miniscreen}" Width="50" Height="50" Margin="1735,38,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" ToolTip="{DynamicResource winmini}"    Click="uxWinMiniBtn_Click"></Button>
                     -->
-                    <!--視窗關閉與最小化 end-->
+                    <!--  視窗關閉與最小化 end  -->
 
-                    <!--切換顯示語系-->
-                    <StackPanel VerticalAlignment="Top" HorizontalAlignment="Left" Orientation="Vertical" Margin="1297,23,0,0" Visibility="Collapsed">
-                        <RadioButton x:Name="uxLangChi"  Width="110" Tag="zh-TW"  Height="40" Content="{DynamicResource languagechi}" Style="{StaticResource uxTimelineRadioButton}" Checked="SysLanChange_Checked"/>
-                        <RadioButton x:Name="uxLangEng" Width="110" Tag="en-US" Height="40" Content="{DynamicResource languageeng}" Style="{StaticResource uxTimelineRadioButton}" Checked="SysLanChange_Checked"/>
+                    <!--  切換顯示語系  -->
+                    <StackPanel
+                        Margin="1297,23,0,0"
+                        HorizontalAlignment="Left"
+                        VerticalAlignment="Top"
+                        Orientation="Vertical"
+                        Visibility="Collapsed">
+                        <RadioButton
+                            x:Name="uxLangChi"
+                            Width="110"
+                            Height="40"
+                            Checked="SysLanChange_Checked"
+                            Content="{DynamicResource languagechi}"
+                            Style="{StaticResource uxTimelineRadioButton}"
+                            Tag="zh-TW" />
+                        <RadioButton
+                            x:Name="uxLangEng"
+                            Width="110"
+                            Height="40"
+                            Checked="SysLanChange_Checked"
+                            Content="{DynamicResource languageeng}"
+                            Style="{StaticResource uxTimelineRadioButton}"
+                            Tag="en-US" />
                     </StackPanel>
-                    <!--切換顯示語系 end-->
+                    <!--  切換顯示語系 end  -->
 
-                    <!--切換要設定歷史牆的語系-->
-                    <!--Margin="659,101,0,0"-->
-                    <StackPanel x:Name="LanInfo" VerticalAlignment="Top" HorizontalAlignment="Left" Orientation="Horizontal" Margin="1297,23,0,0"
-                                >
-                        <RadioButton x:Name="uxLangOne" Width="110" Height="40"
-                                     Style="{StaticResource uxTopRadioButton}" Tag="EventLangOne"
-                                     Checked="HisEventLanChange_Checked" Visibility="Visible" />
-                        <RadioButton x:Name="uxLangTwo" Width="110" Height="40"
-                                     Style="{StaticResource uxTopRadioButton}" Margin="20,0,0,0" Tag="EventLangTwo"
-                                     Checked="HisEventLanChange_Checked" Visibility="Visible"/>
-                        <RadioButton x:Name="uxLangThree" Width="110" Height="40"
-                                     Style="{StaticResource uxTopRadioButton}" Margin="20,0,0,0" Tag="EventLangThree"
-                                     Checked="HisEventLanChange_Checked" Visibility="Collapsed"/>
-                        <RadioButton x:Name="uxLangFour" Width="110" Height="40"
-                                     Style="{StaticResource uxTopRadioButton}" Margin="20,0,0,0" Tag="EventLangFour"
-                                     Checked="HisEventLanChange_Checked" Visibility="Collapsed"/>
+                    <!--  切換要設定歷史牆的語系  -->
+                    <!--  Margin="659,101,0,0"  -->
+                    <StackPanel
+                        x:Name="LanInfo"
+                        Margin="1297,23,0,0"
+                        HorizontalAlignment="Left"
+                        VerticalAlignment="Top"
+                        Orientation="Horizontal"
+                        Visibility="Collapsed">
+                        <RadioButton
+                            x:Name="uxLangOne"
+                            Width="110"
+                            Height="40"
+                            Checked="HisEventLanChange_Checked"
+                            Style="{StaticResource uxTopRadioButton}"
+                            Tag="EventLangOne"
+                            Visibility="Visible" />
+                        <RadioButton
+                            x:Name="uxLangTwo"
+                            Width="110"
+                            Height="40"
+                            Margin="20,0,0,0"
+                            Checked="HisEventLanChange_Checked"
+                            Style="{StaticResource uxTopRadioButton}"
+                            Tag="EventLangTwo"
+                            Visibility="Visible" />
+                        <RadioButton
+                            x:Name="uxLangThree"
+                            Width="110"
+                            Height="40"
+                            Margin="20,0,0,0"
+                            Checked="HisEventLanChange_Checked"
+                            Style="{StaticResource uxTopRadioButton}"
+                            Tag="EventLangThree"
+                            Visibility="Collapsed" />
+                        <RadioButton
+                            x:Name="uxLangFour"
+                            Width="110"
+                            Height="40"
+                            Margin="20,0,0,0"
+                            Checked="HisEventLanChange_Checked"
+                            Style="{StaticResource uxTopRadioButton}"
+                            Tag="EventLangFour"
+                            Visibility="Collapsed" />
                     </StackPanel>
-                    <!--切換要設定歷史牆的語系 end-->
+                    <!--  切換要設定歷史牆的語系 end  -->
 
-                    <StackPanel VerticalAlignment="Top" HorizontalAlignment="Left" Margin="1297,0,0,0" Orientation="Horizontal">
+                    <StackPanel
+                        Margin="1297,0,0,0"
+                        HorizontalAlignment="Left"
+                        VerticalAlignment="Top"
+                        Orientation="Horizontal"
+                        Visibility="Collapsed">
                         <TextBlock Text="選擇顯示語系進行編輯:" />
-                        <Rectangle Width="20"/>
+                        <Rectangle Width="20" />
                         <TextBlock Text="(資料個數與事件多媒體為同步)" Foreground="Red" />
                     </StackPanel>
 
                 </Grid>
 
-                <Grid x:Name="uxContainer" Grid.Row="1" HorizontalAlignment="Center">
-
-                </Grid>
+                <Grid
+                    x:Name="uxContainer"
+                    Grid.Row="1"
+                    HorizontalAlignment="Center" />
 
             </Grid>
-            <Grid x:Name="uxDataUpdateGd" Background="#AA000000"  Visibility="Collapsed" Grid.RowSpan="2">
-                    <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="48" Foreground="White" Text="{DynamicResource dataUpgrade}"></TextBlock>
-                </Grid>
+            <Grid
+                x:Name="uxDataUpdateGd"
+                Grid.RowSpan="2"
+                Background="#AA000000"
+                Visibility="Collapsed">
+                <TextBlock
+                    HorizontalAlignment="Center"
+                    VerticalAlignment="Center"
+                    Text="{DynamicResource dataUpgrade}"
+                    FontSize="48"
+                    Foreground="White" />
             </Grid>
-
         </Grid>
-    
+
+    </Grid>
+
 </UserControl>