Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Example error
#1
Hi, I found there is a small error in the CookBook example file. Thanks!
[Image: gP8I7Rc.png]

Code:
Copy      Help
// script "test1.cs"
using System.Windows;
using System.Windows.Controls;

var b = new wpfBuilder("Window").WinSize(300);

b.R.AddButton("Context menu", o => {
    var m = new popupMenu();
    var e1 = m.AddEnum<KMod>(KMod.Ctrl|KMod.Alt); //a [Flags] enum
    m.Separator();
    var e2 = m.AddEnum<DayOfWeek>(DateTime.Today.DayOfWeek); //a non-[Flags] enum
    var r = o.Button.RectInScreen();
    m.Show(MSFlags.AlignRectBottomTop, excludeRect: r, owner: o.Window);
    
    m.Show(PMFlags.AlignRectBottomTop, excludeRect: r, owner: o.Window);
    print.it(e1.Result);
    print.it(e2.Result);
});


b.R.AddEnum<KMod>(out var e1, KMod.Ctrl | KMod.Alt, label: "Modifiers", vertical: false);
b.R.AddEnum<DayOfWeek>(out var e2, DateTime.Today.DayOfWeek, label: "Day");
b.R.AddOkCancel();
if (!b.ShowDialog()) return;
print.it(e1.Result);
print.it(e2.Result);


Forum Jump:


Users browsing this thread: 1 Guest(s)