public override EvasObject CreateContent(EvasObject parent) { Box box = new ColoredBox(parent); box.Show(); var naviIconPath = Path.Combine(Tizen.Applications.Application.Current.DirectoryInfo.Resource, "menu.png"); var appbar = new MTopAppBar(parent) { Title = "Page title", NavigationItem = new MActionItem("naviItem", naviIconPath, () => { Console.WriteLine($"Navigation action item clicked"); }) }; appbar.Show(); box.PackStart(appbar); var airplaneIconPath = Path.Combine(Tizen.Applications.Application.Current.DirectoryInfo.Resource, "airplane.png"); var alarmIconPath = Path.Combine(Tizen.Applications.Application.Current.DirectoryInfo.Resource, "alarm.png"); var bluetoothIconPath = Path.Combine(Tizen.Applications.Application.Current.DirectoryInfo.Resource, "bluetooth.png"); appbar.ActionItems.Add(new MActionItem("airplane", airplaneIconPath, () => { Console.WriteLine($"ariplane"); })); appbar.ActionItems.Add(new MActionItem("alarm", alarmIconPath, () => { Console.WriteLine($"alarm"); })); appbar.ActionItems.Add(new MActionItem("bluetooth", bluetoothIconPath, () => { Console.WriteLine($"bluetooth"); })); var bButton = new MButton(parent) { Text = "set/unset bg", MinimumWidth = 400, WeightY = 1, AlignmentY = 0.5, }; var bFlag = true; bButton.Clicked += (s, e) => { if (bFlag) { appbar.BackgroundOption = BackgroundOptions.Center; appbar.BackgroundImageFile = Path.Combine(Tizen.Applications.Application.Current.DirectoryInfo.Resource, "photo.jpg"); } else { appbar.BackgroundImageFile = ""; } bFlag = !bFlag; }; bButton.Show(); var nButton = new MButton(parent) { Text = "add/remove naviitem", MinimumWidth = 400, WeightY = 1, AlignmentY = 0.5, }; var item = new MActionItem("new", naviIconPath, () => { Console.WriteLine($"new Navigation action item"); }); nButton.Clicked += (s, e) => { if (appbar.NavigationItem == null) { appbar.NavigationItem = item; } else { appbar.NavigationItem = null; } }; nButton.Show(); var ltButton = new MButton(parent) { Text = "change title", MinimumWidth = 400, WeightY = 1, AlignmentY = 0.5, }; bool ltFlag = true; ltButton.Clicked += (s, e) => { if (ltFlag) { appbar.Title = "Page title"; } else { appbar.Title = "Page title looooooooooooooooooooong"; } ltFlag = !ltFlag; }; ltButton.Show(); var tButton = new MButton(parent) { Text = "change title color", MinimumWidth = 400, WeightY = 1, AlignmentY = 0.5, }; bool tFlag = true; tButton.Clicked += (s, e) => { if (tFlag) { appbar.TitleColor = Color.Red; } else { appbar.TitleColor = Color.Default; } tFlag = !tFlag; }; tButton.Show(); var pButton = new MButton(parent) { Text = "prominent on/off", MinimumWidth = 400, WeightY = 1, AlignmentY = 0.5, }; pButton.Show(); pButton.Clicked += (s, e) => { appbar.Prominent = !appbar.Prominent; }; var addButton = new MButton(parent) { Text = "add item", MinimumWidth = 400, WeightY = 1, AlignmentY = 0.5, }; addButton.Clicked += (s, e) => { var iconPath = Path.Combine(Tizen.Applications.Application.Current.DirectoryInfo.Resource, "image.png"); appbar.ActionItems.Add(new MActionItem("new item", iconPath, () => { Console.WriteLine($"new item"); })); }; addButton.Show(); var removeButton = new MButton(parent) { Text = "remove item", MinimumWidth = 400, WeightY = 1, AlignmentY = 0.5, }; removeButton.Clicked += (s, e) => { if (appbar.ActionItems.Count > 0) { appbar.ActionItems.RemoveAt(appbar.ActionItems.Count - 1); } }; removeButton.Show(); box.PackEnd(bButton); box.PackEnd(pButton); box.PackEnd(nButton); box.PackEnd(ltButton); box.PackEnd(tButton); box.PackEnd(addButton); box.PackEnd(removeButton); return(box); }
public override EvasObject CreateContent(EvasObject parent) { Box box = new ColoredBox(parent); box.Show(); MNavigationView nv = new MNavigationView(parent); var paddingbox = new Box(parent) { AlignmentX = -1, AlignmentY = -1, MinimumWidth = 32, }; paddingbox.Show(); var paddingbox1 = new Box(parent) { AlignmentX = -1, AlignmentY = -1, MinimumWidth = 32, }; paddingbox1.Show(); var paddingbox2 = new Box(parent) { AlignmentX = -1, AlignmentY = -1, MinimumHeight = 30, }; paddingbox2.Show(); var paddingbox3 = new Box(parent) { AlignmentX = -1, AlignmentY = -1, MinimumHeight = 10, }; paddingbox3.Show(); var name = new Label(parent) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, Text = "<span font_weight=bold font_size=50>Tizen</span>", MinimumHeight = 80 }; name.Show(); var namebox = new Box(parent) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, IsHorizontal = true, }; namebox.Show(); namebox.PackEnd(paddingbox); namebox.PackEnd(name); var email = new Label(parent) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, Text = "<span font_size=35>[email protected]<span>", }; email.Show(); var emailbox = new Box(parent) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, IsHorizontal = true, }; emailbox.Show(); emailbox.PackEnd(paddingbox1); emailbox.PackEnd(email); var header = new Box(parent) { MinimumHeight = 200, BackgroundColor = Color.White }; header.PackEnd(paddingbox2); header.PackEnd(namebox); header.PackEnd(emailbox); header.PackEnd(paddingbox3); header.Show(); nv.Header = header; var items1 = new List <MItem>(); items1.Add(new MItem("My Files", "icon.png")); items1.Add(new MItem("Shared with me", "icon.png")); items1.Add(new MItem("Starred", "icon.png")); items1.Add(new MItem("Recent", "icon.png")); items1.Add(new MItem("Offline", "icon.png")); var items2 = new List <MItem>(); items2.Add(new MItem("Uploads", "icon.png")); items2.Add(new MItem("Backup", "icon.png")); items2.Add(new MItem("Movie", "icon.png")); items2.Add(new MItem("Music", "icon.png")); items2.Add(new MItem("Play", "icon.png")); var group1 = new MGroup(items1, "Account"); var group2 = new MGroup(items2); var groups = new List <MGroup>(); groups.Add(group1); groups.Add(group2); nv.GroupMenu = groups; var main1 = new MButton(parent) { Text = "Open NavigationView", AlignmentX = 0, AlignmentY = 0, MinimumWidth = 720, MinimumHeight = 300 }; main1.Show(); var nd = new MNavigationDrawer(parent) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, }; nd.Main = main1; nd.NavigationView = nv; main1.Clicked += (s, e) => { nd.IsOpen = true; }; nd.Show(); box.PackEnd(nd); return(box); }
public EvasObject CreateThemePage(EvasObject parent) { var label = new Label(parent) { Text = "<span align='center'><br><b>Choose Theme</b></span>", Color = Color.FromHex("6200EE"), AlignmentX = 0.5, AlignmentY = 0.5, WeightX = 1, WeightY = 1, MinimumWidth = _screenWidth, }; label.Show(); Box box = new ColoredBox(parent) { IsHorizontal = false, WeightX = 1, WeightY = 1, AlignmentX = -1, AlignmentY = -1, }; box.Show(); var defaultColor = new MButton(parent) { Text = "default", MinimumWidth = 200, WeightY = 1, AlignmentY = 0.5 }; var light = new MButton(parent) { Text = "light", BackgroundColor = Color.Silver, MinimumWidth = 200, WeightY = 1, AlignmentY = 0.5 }; var dark = new MButton(parent) { Text = "Dark", BackgroundColor = Color.Black, MinimumWidth = 200, WeightY = 1, AlignmentY = 0.5 }; defaultColor.Show(); light.Show(); dark.Show(); box.PackEnd(label); box.PackEnd(defaultColor); box.PackEnd(light); box.PackEnd(dark); defaultColor.Clicked += (s, e) => MColors.Current = MColors.Default; light.Clicked += (s, e) => MColors.Current = MColors.Light; dark.Clicked += (s, e) => MColors.Current = MColors.Dark; return(box); }
public override EvasObject CreateContent(EvasObject parent) { Box box = new ColoredBox(parent); box.Show(); MNavigationView nv = new MNavigationView(parent) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, }; var btn1 = new Button(parent) { Text = "Chage Header / Background", AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, MinimumHeight = 300, }; btn1.Show(); var btn2 = new Button(parent) { Text = "Chage Header / Background", AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, BackgroundColor = Color.Blue }; btn2.Show(); var btn3 = new Button(parent) { Text = "Button", AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, }; btn3.Show(); var header = new Box(parent) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, BackgroundColor = Color.White }; header.PackEnd(btn2); header.PackEnd(btn3); header.Show(); nv.Header = btn1; btn1.Clicked += (s, e) => { nv.Header = header; var img = new Image(parent); var path = Path.Combine(Tizen.Applications.Application.Current.DirectoryInfo.Resource, "photo.jpg"); img.LoadAsync(path); img.IsFixedAspect = false; img.CanFillOutside = true; nv.BackgroundImage = img; }; btn2.Clicked += (s, e) => { nv.Header = btn1; nv.BackgroundImage = null; }; var items = new List <MItem>(); items.Add(new MItem("My Files", "icon.png")); items.Add(new MItem("Shared with me", "icon.png")); items.Add(new MItem("Starred", "icon.png")); items.Add(new MItem("Recent", "icon.png")); items.Add(new MItem("Offline", "icon.png")); items.Add(new MItem("Uploads", "icon.png")); items.Add(new MItem("Backup", "icon.png")); items.Add(new MItem("Movie", "icon.png")); items.Add(new MItem("Music", "icon.png")); items.Add(new MItem("Play", "icon.png")); var items1 = new List <MItem>(); for (int i = 0; i < 20; i++) { items1.Add(new MItem("Change Item", "icon.png")); } nv.Menu = items; var dividers = new List <int>(); dividers.Add(1); dividers.Add(3); dividers.Add(5); nv.MenuItemSelected += (s, e) => { if (nv.Menu == items) { nv.Menu = items1; } else { nv.Menu = items; } }; nv.Show(); box.PackEnd(nv); return(box); }
public override EvasObject CreateContent(EvasObject parent) { Box box = new ColoredBox(parent); box.Show(); MNavigationView nv = new MNavigationView(parent) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, }; var btn1 = new Button(parent) { Text = "Chage Header", AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, MinimumHeight = 300, }; btn1.Show(); var btn2 = new Button(parent) { Text = "Chage Header", AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, BackgroundColor = Color.Blue }; btn2.Show(); var btn3 = new Button(parent) { Text = "Button", AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, }; btn3.Show(); var header = new Box(parent) { AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, BackgroundColor = Color.White }; header.PackEnd(btn2); header.PackEnd(btn3); header.Show(); nv.Header = btn1; btn1.Clicked += (s, e) => { nv.Header = header; }; btn2.Clicked += (s, e) => { nv.Header = btn1; }; var items = new List <MItem>(); items.Add(new MItem("My Files", "icon.png")); items.Add(new MItem("Shared with me", "icon.png")); items.Add(new MItem("Starred", "icon.png")); items.Add(new MItem("Recent", "icon.png")); items.Add(new MItem("Offline", "icon.png")); items.Add(new MItem("Uploads", "icon.png")); items.Add(new MItem("Backup", "icon.png")); items.Add(new MItem("Movie", "icon.png")); items.Add(new MItem("Music", "icon.png")); items.Add(new MItem("Play", "icon.png")); var items1 = new List <MItem>(); for (int i = 0; i < 20; i++) { items1.Add(new MItem("Change Item", "icon.png")); } nv.Menu = items; var dividers = new List <int>(); dividers.Add(1); dividers.Add(3); dividers.Add(5); nv.MenuItemSelected += (s, e) => { if (nv.Menu == items) { nv.Menu = items1; } else { nv.Menu = items; } }; nv.Show(); box.PackEnd(nv); return(box); }
public override EvasObject CreateContent(EvasObject parent) { if (_conformant == null) { return(null); } Box box = new ColoredBox(parent); box.Show(); #region ModalSheets MModalSheets modalSheets = new MModalSheets(_conformant, MModalSheetsDirection.Bottom); modalSheets.Show(); GenList genlist = new GenList(_conformant) { Homogeneous = true, AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, }; GenItemClass defaultClass = new GenItemClass(Styles.GenListItem.MaterialNavigation) { GetTextHandler = (obj, part) => { return(((MItem)obj).Title); }, GetContentHandler = (obj, part) => { var icon = ((MItem)obj).Icon; if (icon != null) { var image = new Image(_conformant); var result = image.Load(Path.Combine(Tizen.Applications.Application.Current.DirectoryInfo.Resource, icon)); return(image); } else { return(null); } } }; genlist.Append(defaultClass, new MItem("Share", "share.png")); genlist.Append(defaultClass, new MItem("Get link", "insert-link.png")); genlist.Append(defaultClass, new MItem("Edit name", "edit.png")); genlist.Append(defaultClass, new MItem("Delete collection", "delete.png")); modalSheets.SetContent(genlist); #endregion #region Buttons Box btbox = new Box(parent) { WeightX = 1, WeightY = 0.3, AlignmentX = -1, AlignmentY = -1, }; btbox.Show(); box.PackEnd(btbox); MButton button1 = new MButton(parent) { Text = "Open MModalBottomSheets", MinimumWidth = 600, AlignmentY = 0, WeightY = 0.3, }; button1.Show(); button1.Clicked += (s, e) => { modalSheets.IsOpen = true; }; btbox.PackEnd(button1); #endregion return(box); }
public override void Run(Window window) { Conformant conformant = new Conformant(window); conformant.Show(); Box box = new ColoredBox(window); conformant.SetContent(box); box.SetPadding(0, 100); box.Show(); var innerbox = new Box(window) { MinimumWidth = 500, AlignmentX = 0.5, AlignmentY = 0.5, WeightX = 1, WeightY = 1, IsHorizontal = false }; innerbox.Show(); box.PackEnd(innerbox); #region ThemeButton Box hbox = new Box(window) { IsHorizontal = true, WeightX = 1, WeightY = 1, AlignmentX = -1, AlignmentY = -1, }; hbox.Show(); box.PackEnd(hbox); var defaultColor = new MButton(window) { Text = "default", MinimumWidth = 200, WeightY = 1, AlignmentY = 0.9 }; var light = new MButton(window) { Text = "light", MinimumWidth = 200, WeightY = 1, AlignmentY = 0.9 }; var dark = new MButton(window) { Text = "Dark", MinimumWidth = 200, WeightY = 1, AlignmentY = 0.9 }; defaultColor.Show(); light.Show(); dark.Show(); hbox.PackEnd(defaultColor); hbox.PackEnd(light); hbox.PackEnd(dark); defaultColor.Clicked += (s, e) => MColors.Current = MColors.Default; light.Clicked += (s, e) => MColors.Current = MColors.Light; dark.Clicked += (s, e) => MColors.Current = MColors.Dark; #endregion var textfield = new MTextField(window) { Label = "Label", AlignmentX = -1, AlignmentY = 0, WeightX = 1, WeightY = 1 }; textfield.Show(); innerbox.PackEnd(textfield); var emptyLabel = new Label(window) { MinimumWidth = 500, MinimumHeight = 100, WeightX = 1, AlignmentX = -1, }; emptyLabel.Show(); innerbox.PackEnd(emptyLabel); var textfield2 = new MTextField(window) { Label = "Label", Text = "Input text", AlignmentX = -1, AlignmentY = 0, WeightX = 1, WeightY = 1, }; textfield2.Show(); innerbox.PackEnd(textfield2); }
public override EvasObject CreateContent(EvasObject parent) { if (_conformant == null) { return(null); } Box box = new ColoredBox(parent); box.Show(); #region ModalSheets MModalSheets modalSheets = new MModalSheets(_conformant, MModalSheetsDirection.Side); modalSheets.Show(); Label label1 = new Label(parent) { Text = "<span font_size=35 color=#a8a8a8>Labels</span>", AlignmentX = 0, }; label1.Show(); var check1 = new MCheckBox(parent) { Text = "Events", MinimumWidth = 400, }; check1.Show(); var check2 = new MCheckBox(parent) { Text = "Personal", IsChecked = true, MinimumWidth = 400, }; check2.Show(); var check3 = new MCheckBox(parent) { Text = "Project", IsChecked = true, MinimumWidth = 400, }; check3.Show(); var check4 = new MCheckBox(parent) { Text = "Reminders", MinimumWidth = 400, }; check4.Show(); var check5 = new MCheckBox(parent) { Text = "Work", MinimumWidth = 400, }; check5.Show(); var contents = new Box(_conformant) { IsHorizontal = true, AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, BackgroundColor = Color.White, }; contents.Show(); contents.SetPadding(45, 45); var contents1 = new Box(_conformant) { IsHorizontal = true, }; contents1.Show(); contents1.SetPadding(45, 45); contents.PackEnd(contents1); var contents2 = new Box(_conformant) { IsHorizontal = false, AlignmentX = 0, AlignmentY = 0, WeightX = 1, WeightY = 0, }; contents2.Show(); contents2.SetPadding(45, 45); contents.PackEnd(contents2); var contents3 = new Box(_conformant) { IsHorizontal = false, }; contents3.Show(); contents3.SetPadding(45, 45); contents2.PackEnd(contents3); contents2.PackEnd(label1); contents2.PackEnd(check1); contents2.PackEnd(check2); contents2.PackEnd(check3); contents2.PackEnd(check4); contents2.PackEnd(check5); modalSheets.SetContent(contents); #endregion #region Buttons Box btbox = new Box(parent) { WeightX = 1, WeightY = 0.3, AlignmentX = -1, AlignmentY = -1, }; btbox.Show(); box.PackEnd(btbox); MButton button1 = new MButton(parent) { Text = "Open MModalSideSheets", MinimumWidth = 600, AlignmentY = 0, WeightY = 0.3, }; button1.Show(); button1.Clicked += (s, e) => { modalSheets.IsOpen = true; }; btbox.PackEnd(button1); #endregion return(box); }
public override EvasObject CreateContent(EvasObject parent) { if (_conformant == null) { return(null); } Box box = new ColoredBox(parent); box.Show(); var rect = new Rectangle(parent) { WeightX = 1, WeightY = 1, AlignmentX = -1, AlignmentY = -1, }; box.PackEnd(rect); #region FABs MFloatingActionButton fab = new MFloatingActionButton(_conformant); fab.Show(); fab.Resize(180, 176); fab.Move(540, 1070); Image img = new Image(parent); //The source of icon resources is https://materialdesignicons.com/ img.Load(Path.Combine(MaterialGallery.ResourceDir, "alarm.png")); img.Show(); fab.Icon = img; MFloatingActionButton fab2 = new MFloatingActionButton(_conformant); fab2.Show(); fab2.Resize(180, 176); fab2.Move(540, 940); Image img2 = new Image(parent); //The source of icon resources is https://materialdesignicons.com/ img2.Load(Path.Combine(MaterialGallery.ResourceDir, "airplane.png")); img2.Show(); fab2.Icon = img2; MFloatingActionButton fab3 = new MFloatingActionButton(_conformant); fab3.Show(); fab3.Resize(180, 176); fab3.Move(540, 810); Image img3 = new Image(parent); //The source of icon resources is https://materialdesignicons.com/ img3.Load(Path.Combine(MaterialGallery.ResourceDir, "bluetooth.png")); img3.Show(); fab3.Icon = img3; #endregion if (Elementary.GetProfile() == "wearable") { fab.Move(90, 20); fab2.Move(90, 200); fab3.Move(90, 400); fab.Clicked += (s, e) => { parent.Unrealize(); }; } else if (Elementary.GetProfile() == "tv") { fab.Move(1340, 870); fab2.Move(1340, 740); fab3.Move(1340, 610); } return(box); }
public override void Run(Window window) { MConformant conformant = new MConformant(window); conformant.Show(); Box box = new ColoredBox(window); conformant.SetContent(box); box.Show(); #region ThemeButton Box hbox = new Box(window) { IsHorizontal = true, WeightX = 1, WeightY = 0.2, AlignmentX = -1, AlignmentY = -1, }; hbox.Show(); box.PackEnd(hbox); var defaultColor = new MButton(window) { Text = "default", MinimumWidth = 200, WeightY = 1, AlignmentY = 0.5 }; var light = new MButton(window) { Text = "light", MinimumWidth = 200, WeightY = 1, AlignmentY = 0.5 }; var dark = new MButton(window) { Text = "Dark", MinimumWidth = 200, WeightY = 1, AlignmentY = 0.5 }; defaultColor.Show(); light.Show(); dark.Show(); hbox.PackEnd(defaultColor); hbox.PackEnd(light); hbox.PackEnd(dark); defaultColor.Clicked += (s, e) => MColors.Current = MColors.Default; light.Clicked += (s, e) => MColors.Current = MColors.Light; dark.Clicked += (s, e) => MColors.Current = MColors.Dark; #endregion #region FABs MFloatingActionButton fab = new MFloatingActionButton(conformant); fab.Show(); fab.Resize(180, 176); fab.Move(540, 1070); Image img = new Image(window); //The source of icon resources is https://materialdesignicons.com/ img.Load(Path.Combine(MaterialGallery.ResourceDir, "alarm.png")); img.Show(); fab.Icon = img; MFloatingActionButton fab2 = new MFloatingActionButton(conformant); fab2.Show(); fab2.Resize(180, 176); fab2.Move(540, 940); Image img2 = new Image(window); //The source of icon resources is https://materialdesignicons.com/ img2.Load(Path.Combine(MaterialGallery.ResourceDir, "airplane.png")); img2.Show(); fab2.Icon = img2; MFloatingActionButton fab3 = new MFloatingActionButton(conformant); fab3.Show(); fab3.Resize(180, 176); fab3.Move(540, 810); Image img3 = new Image(window); //The source of icon resources is https://materialdesignicons.com/ img3.Load(Path.Combine(MaterialGallery.ResourceDir, "bluetooth.png")); img3.Show(); fab3.Icon = img3; #endregion }
public override void Run(Window window) { Conformant conformant = new Conformant(window); conformant.Show(); Box box = new ColoredBox(window); conformant.SetContent(box); box.Show(); #region ThemeButton Box hbox = new Box(window) { IsHorizontal = true, WeightX = 1, WeightY = 0.1, AlignmentX = -1, AlignmentY = -1, }; hbox.Show(); box.PackEnd(hbox); var defaultColor = new MButton(window) { Text = "default", MinimumWidth = 200, WeightY = 1, AlignmentY = 0.5 }; var light = new MButton(window) { Text = "light", MinimumWidth = 200, WeightY = 1, AlignmentY = 0.5 }; var dark = new MButton(window) { Text = "Dark", MinimumWidth = 200, WeightY = 1, AlignmentY = 0.5 }; defaultColor.Show(); light.Show(); dark.Show(); hbox.PackEnd(defaultColor); hbox.PackEnd(light); hbox.PackEnd(dark); defaultColor.Clicked += (s, e) => MColors.Current = MColors.Default; light.Clicked += (s, e) => MColors.Current = MColors.Light; dark.Clicked += (s, e) => MColors.Current = MColors.Dark; #endregion #region Menus MMenus menu1 = new MMenus(window); menu1.Append("Undo"); menu1.Append("Redo"); var item = menu1.Append("Cut"); item.InsertDividerAbove(); menu1.Append("Copy"); menu1.Append("Paste"); var img1 = new Image(window); img1.Load(Path.Combine(Tizen.Applications.Application.Current.DirectoryInfo.Resource, "visible.png")); var img2 = new Image(window); img2.Load(Path.Combine(Tizen.Applications.Application.Current.DirectoryInfo.Resource, "add-user-male.png")); var img3 = new Image(window); img3.Load(Path.Combine(Tizen.Applications.Application.Current.DirectoryInfo.Resource, "link.png")); var img4 = new Image(window); img4.Load(Path.Combine(Tizen.Applications.Application.Current.DirectoryInfo.Resource, "copy.png")); var img5 = new Image(window); img5.Load(Path.Combine(Tizen.Applications.Application.Current.DirectoryInfo.Resource, "download.png")); MMenus menu2 = new MMenus(window); menu2.Append("Preview", img1); menu2.Append("Share", img2); menu2.Append("Get Link", img3); var item2 = menu2.Append("Preview", img4); item2.InsertDividerAbove(); menu2.Append("Download", img5); #endregion #region Buttons Box btbox = new Box(window) { WeightX = 1, WeightY = 0.3, AlignmentX = -1, AlignmentY = -1, }; btbox.Show(); box.PackEnd(btbox); MButton button1 = new MButton(window) { Text = "Text list", MinimumWidth = 600, AlignmentY = 0, WeightY = 0.3, }; button1.Show(); button1.Clicked += (s, e) => { menu1.Show(); }; MButton button2 = new MButton(window) { Text = "Text and icon list", MinimumWidth = 600, AlignmentY = 0, WeightY = 0.3, }; button2.Show(); button2.Clicked += (s, e) => { menu2.Show(); }; btbox.PackEnd(button1); btbox.PackEnd(button2); #endregion }
public override void Run(Window window) { MConformant conformant = new MConformant(window); conformant.Show(); Box box = new ColoredBox(window); conformant.SetContent(box); box.Show(); #region ThemeButton Box hbox = new Box(window) { IsHorizontal = true, WeightX = 1, WeightY = 0.1, AlignmentX = -1, AlignmentY = -1, }; hbox.Show(); box.PackEnd(hbox); var defaultColor = new MButton(window) { Text = "default", MinimumWidth = 200, WeightY = 1, AlignmentY = 0.5 }; var light = new MButton(window) { Text = "light", MinimumWidth = 200, WeightY = 1, AlignmentY = 0.5 }; var dark = new MButton(window) { Text = "Dark", MinimumWidth = 200, WeightY = 1, AlignmentY = 0.5 }; defaultColor.Show(); light.Show(); dark.Show(); hbox.PackEnd(defaultColor); hbox.PackEnd(light); hbox.PackEnd(dark); defaultColor.Clicked += (s, e) => MColors.Current = MColors.Default; light.Clicked += (s, e) => MColors.Current = MColors.Light; dark.Clicked += (s, e) => MColors.Current = MColors.Dark; #endregion #region ModalSheets MModalSheets modalSheets = new MModalSheets(conformant, MModalSheetsDirection.Bottom); modalSheets.Show(); GenList genlist = new GenList(conformant) { Homogeneous = true, AlignmentX = -1, AlignmentY = -1, WeightX = 1, WeightY = 1, }; GenItemClass defaultClass = new GenItemClass(Styles.GenListItem.MaterialNavigation) { GetTextHandler = (obj, part) => { return(((MItem)obj).Title); }, GetContentHandler = (obj, part) => { var icon = ((MItem)obj).Icon; if (icon != null) { var image = new Image(conformant); var result = image.Load(Path.Combine(Tizen.Applications.Application.Current.DirectoryInfo.Resource, icon)); return(image); } else { return(null); } } }; genlist.Append(defaultClass, new MItem("Share", "share.png")); genlist.Append(defaultClass, new MItem("Get link", "insert-link.png")); genlist.Append(defaultClass, new MItem("Edit name", "edit.png")); genlist.Append(defaultClass, new MItem("Delete collection", "delete.png")); modalSheets.SetContent(genlist); #endregion #region Buttons Box btbox = new Box(window) { WeightX = 1, WeightY = 0.3, AlignmentX = -1, AlignmentY = -1, }; btbox.Show(); box.PackEnd(btbox); MButton button1 = new MButton(window) { Text = "Open MModalBottomSheets", MinimumWidth = 600, AlignmentY = 0, WeightY = 0.3, }; button1.Show(); button1.Clicked += (s, e) => { modalSheets.IsOpen = true; }; btbox.PackEnd(button1); #endregion }