public void SetRectangularViewfinderLineStyle(RectangularViewfinderLineStyle style) { ViewfinderType currentViewfinder = this.GetCurrentViewfinderType(); if (currentViewfinder is ViewfinderTypeRectangular) { ((ViewfinderTypeRectangular)currentViewfinder).LineStyle = style; this.SetViewfinderType(currentViewfinder); } }
private void BuildAndShowRectangularLineStyleMenu() { PopupMenu menu = new PopupMenu(this.RequireContext(), this.containerRectangularLineStyle, GravityFlags.End); RectangularViewfinderLineStyle[] values = RectangularViewfinderLineStyle.Values(); for (int i = 0; i < values.Length; i++) { RectangularViewfinderLineStyle style = values[i]; menu.Menu.Add(0, i, i, style.Name()); } menu.MenuItemClick += (object sender, PopupMenu.MenuItemClickEventArgs args) => { int selectedStyle = args.Item.ItemId; this.viewModel.SetRectangularViewfinderLineStyle( RectangularViewfinderLineStyle.Values()[selectedStyle] ); this.ShowHideSubSettings(); }; menu.Show(); }
public RectangularViewfinderLineStyleType(RectangularViewfinderLineStyle lineStyle) : base((int)lineStyle, lineStyle.ToString()) { this.LineStyle = lineStyle; }