@@ -28,30 +28,30 @@ namespace One.Toolbox.ViewModels.Stick;
2828
2929public partial class StickItemVM : BaseVM
3030{
31- /// <summary> 预览 </summary>
32- [ ObservableProperty ]
33- private ImageSource screen ;
34-
35- [ ObservableProperty ]
36- private bool showAddContent = true ;
37-
38- [ ObservableProperty ]
39- private string buttonContent = "显示" ;
40-
4131 public StickWindow StickWindow { get ; set ; }
4232
4333 public int Index { get ; set ; }
4434
45- [ ObservableProperty ]
46- private bool defaultOn ;
47-
4835 partial void OnDefaultOnChanged ( bool value )
4936 {
5037 SaveSetting ( ) ;
5138 }
5239
5340 #region Prop
5441
42+ [ ObservableProperty ]
43+ private bool defaultOn ;
44+
45+ /// <summary> 预览 </summary>
46+ [ ObservableProperty ]
47+ private ImageSource screen ;
48+
49+ [ ObservableProperty ]
50+ private bool showAddContent = true ;
51+
52+ [ ObservableProperty ]
53+ private string buttonContent = "显示" ;
54+
5555 [ ObservableProperty ]
5656 private StickType stickType ;
5757
@@ -74,7 +74,6 @@ partial void OnDefaultOnChanged(bool value)
7474
7575 private RichTextboxEx currentRtb ;
7676 private System . Windows . Controls . Primitives . Popup popup ;
77- //private const string configName = "sticks.txt";
7877
7978 //string tempPath;
8079 public StickItemVM ( int index )
@@ -127,7 +126,8 @@ private BitmapImage BitmapToBitmapImage(System.Drawing.Bitmap bitmap)
127126
128127 private void ScreenTheWindow ( )
129128 {
130- System . Windows . Media . Imaging . RenderTargetBitmap targetBitmap = new System . Windows . Media . Imaging . RenderTargetBitmap ( ( int ) StickWindow . ActualWidth , ( int ) StickWindow . ActualHeight , 96d , 96d , System . Windows . Media . PixelFormats . Default ) ;
129+ RenderTargetBitmap targetBitmap = new RenderTargetBitmap ( ( int ) StickWindow . ActualWidth , ( int ) StickWindow . ActualHeight , 96d , 96d , System . Windows . Media . PixelFormats . Default ) ;
130+
131131 targetBitmap . Render ( StickWindow ) ;
132132 System . Windows . Media . Imaging . PngBitmapEncoder saveEncoder = new System . Windows . Media . Imaging . PngBitmapEncoder ( ) ;
133133 saveEncoder . Frames . Add ( System . Windows . Media . Imaging . BitmapFrame . Create ( targetBitmap ) ) ;
@@ -272,7 +272,7 @@ void InitData()
272272 {
273273 try
274274 {
275- var m = IOHelper . Instance . ReadContentFromLocal < StickM > ( One . Toolbox . Helpers . PathHelper . stickPath + "Stick" + Index + ".data" ) ;
275+ var m = IOHelper . Instance . ReadContentFromLocal < StickItemM > ( One . Toolbox . Helpers . PathHelper . stickPath + "Stick" + Index + ".data" ) ;
276276
277277 CurrentTheme = m . CurrentTheme ;
278278 StickName = m . StickName ;
@@ -388,9 +388,9 @@ private void TestA(object obj)
388388
389389 #endregion CenterCommand
390390
391- public StickM ToModel ( )
391+ public StickItemM ToModel ( )
392392 {
393- StickM stickM = new StickM ( ) ;
393+ StickItemM stickM = new StickItemM ( ) ;
394394 stickM . CurrentTheme = CurrentTheme ;
395395 stickM . StickName = StickName ;
396396 stickM . StickType = StickType ;
@@ -401,7 +401,7 @@ public StickM ToModel()
401401 }
402402}
403403
404- public class StickM
404+ public class StickItemM
405405{
406406 public StickTheme CurrentTheme { get ; set ; }
407407 public string StickName { get ; set ; }
0 commit comments