public override UserControl CreateVisualObject(double mtpWidth, double mtpHeight) { UserControl c = null; // ReSharper disable once ConditionIsAlwaysTrueOrFalse #pragma warning disable 162 if (true || mtpWidth <= 50 || mtpHeight <= 40) #pragma warning restore 162 { var bvt = new MtpViewPIDCntlTiny(); c = bvt; c.Width = 40; c.Height = 30; c.DataContext = this; bvt.ButtonGo.Click += ButtonGo_Click; } else // ReSharper disable once HeuristicUnreachableCode #pragma warning disable 162 { // ReSharper disable once HeuristicUnreachableCode var bvl = new MtpViewBinViewLarge(); c = bvl; c.Width = 130; c.Height = 96; c.DataContext = this; bvl.ButtonGo.Click += ButtonGo_Click; } #pragma warning restore 162 Demo(2); return(c); }
public override UserControl CreateVisualObject(double mtpWidth, double mtpHeight) { UserControl c = null; if (mtpWidth <= 50 || mtpHeight <= 40) { var bvt = new MtpViewBinViewTiny(); c = bvt; c.Width = 40; c.Height = 30; c.DataContext = this; bvt.ButtonGo.Click += ButtonGo_Click; } else { var bvl = new MtpViewBinViewLarge(); c = bvl; c.Width = 130; c.Height = 96; c.DataContext = this; bvl.ButtonGo.Click += ButtonGo_Click; } Demo(2); return(c); }