12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows;
- using FurnaceUI.Models;
- namespace FurnaceUI.Client.Dialog
- {
- public class SelectExistViewModel : FurnaceUIViewModelBase
- {
- private SelectExistView _view;
- public string DialogResultString { get; set; }
- private string _productZeroStr;
- public string ProductZeroStr
- {
- get => _productZeroStr;
- set
- {
- _productZeroStr = value;
- NotifyOfPropertyChange(nameof(ProductZeroStr));
- }
- }
- protected override void OnViewLoaded(object view)
- {
- base.OnViewLoaded(view);
- _view=(SelectExistView)view;
- LoadSetDefaultOption(view);
- }
- private void LoadSetDefaultOption(object view)
- {
- if (_view != null && !string.IsNullOrEmpty(ProductZeroStr))
- {
- switch (ProductZeroStr.ToLower())
- {
- case "none":
- _view.RdoNone.IsChecked = true;
- break;
- case "exist":
- _view.RdoExist.IsChecked = true;
- break;
- default:
- break;
- }
- }
- }
- public void SelectExistClick(string cmd,object obj)
- {
- DialogResultString = cmd;
- if (cmd == "Cancel")
- {
- ((Window)GetView()).DialogResult = false;
- }
- else
- {
- ((Window)GetView()).DialogResult = true;
- }
- }
- }
- }
|