Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
wpf question - access data in Action
#3
ButtonResult is 0 because in the tab-dialog code each page has its wpfBuilder.

C# code:
// script ""
using System.Windows.Controls;

var bMain = new wpfBuilder("Window").WinSize(400);
bMain.Row(-1).Add(out TabControl tc).Height(300..);
bMain.R.AddOkCancel(apply: "_Apply");

wpfBuilder _Page(string name, WBPanelType panelType = WBPanelType.Grid) {
    var tp = new TabItem { Header = name };
    tc.Items.Add(tp);
    return new wpfBuilder(tp, panelType);
}

//--------------------------------

var b1 = _Page("Page1");
b1.R.AddButton("Page1 result", 10);
b1.End();

//--------------------------------

var b2 = _Page("Page2");
b2.R.AddButton("Page2 result", 20);
b2.End();

//--------------------------------

bMain.R.AddButton("Main result", 100);
bMain.End();

if (!bMain.ShowDialog()) return;

print.it(bMain.ResultButton, b1.ResultButton, b2.ResultButton);


Messages In This Thread
RE: wpf question - access data in Action - by Gintaras - 12-21-2021, 11:15 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)