public MainWindow() { InitializeComponent(); VM = new LKBackGround(); this.DataContext = VM; LKNotifyIcon lkNotifyIcon = new LKNotifyIcon(); lkNotifyIcon.OnChangeWindowState += LkNotifyIcon_OnChangeWindowState; ucScreenUnlock.OnRememberPoint += UcScreenUnlock_OnRememberPoint; txtPwd.Text = ConfigManager.GetNumPass(); }
/// <summary> /// 选择文件路径 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Image_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { OpenFileDialog of = new OpenFileDialog(); of.Filter = LKBackGround.GetFilter((int)VM.BackType); if (!string.IsNullOrWhiteSpace(VM.FilePath)) { of.InitialDirectory = System.IO.Path.GetDirectoryName(VM.FilePath); } else { of.InitialDirectory = AppDomain.CurrentDomain.BaseDirectory; } if (of.ShowDialog() == true) { VM.FilePath = of.FileName; } }