/// <summary> /// コンストラクタ。 /// </summary> /// <param name="windowControl">ウィンドウコントロール</param> /// <param name="viewModel">ViewModel</param> public Output(WindowControl windowControl, OutputViewModel viewModel) { var visualTree = windowControl.VisualTree(); this.ViewModel = viewModel; this.OutputFolder = new WPFTextBox(visualTree.ByBinding("OutputFolder").Single()); this.IsAutoSaveImage = new WPFToggleButton(visualTree.ByBinding("IsAutoSaveImage").Single()); }
public void TestInitialize() { _app = new WindowsAppFriend(Process.Start("Target.exe")); WindowsAppExpander.LoadAssembly(_app, GetType().Assembly); dynamic main = _app.Type<Application>().Current.MainWindow; dynamic checkBox = _app.Type<CheckBox>()(); main._grid.Children.Add(checkBox); _toggle = new WPFToggleButton(checkBox); }
public void TestInitialize() { _app = new WindowsAppFriend(Process.Start("Target.exe")); WindowsAppExpander.LoadAssembly(_app, GetType().Assembly); dynamic main = _app.Type <Application>().Current.MainWindow; dynamic checkBox = _app.Type <CheckBox>()(); main._grid.Children.Add(checkBox); _toggle = new WPFToggleButton(checkBox); }
void Assert(string accessPath, WPFToggleButton toggleButton) { var value = toggleButton.IsChecked == null ? "null" : toggleButton.IsChecked.Value.ToString().ToLower(); CaptureAdaptor.AddCode($"{accessPath}.IsChecked.Is({value});"); }