private ClearUC.ListViewItems.ListItem CreateSubItem(Page.Album.AlbumData.Track Track) { ListAnimativeItem Lai = new ListAnimativeItem(true); Lai.DataType = typeof(Page.Album.AlbumData.Track); Lai.Data = Track; ListSubItem lsi = new ListSubItem(); if (Track.TrackNumber > 0) { lsi.LeftItem = ListSubItem.LeftItems.Number; lsi.NumberLabelText = Track.TrackNumber.ToString(); } Lai.ItemsHeight = lsi.Height; lsi.SubLabelVisibility = Visibility.Visible; lsi.SubLabelText = "Unknown"; lsi.MainLabelText = System.IO.Path.GetFileName(Track.Path) + " - " + Utils.Config.Language.Strings.Path.File; lsi.SubLabelText = Utils.Config.Language.Strings.Window.Album.Disc + ":" + Track.DiscNumber + " (" + Track.Path + ")"; Lai.FirstItem = lsi; ListButtonsItem lbi = new ListButtonsItem(); ListButtonsItem.ListButton Remove = new ListButtonsItem.ListButton(Lai); Remove.Click += Remove_Click; Remove.Content = Utils.Config.Language.Strings.ContextMenu.Remove; lbi.Add(Remove); Lai.SecondItem = lbi; return(Lai); }
private void InitializeLAPPanel() { MW.OptionalView.ItemClicked += OptionalView_ItemClicked; MW.OptionalView.Items.Clear(); double PerHeight = 35; OpenItem = new ListSubItem(); OpenItem.MainLabelText = Localize.Get(Strings.Open); OpenItem.SubLabelVisibility = Visibility.Hidden; OpenItem.Height = PerHeight; MW.OptionalView.Items.Add(OpenItem); MW.OptionalView.Items.Add(new Separator()); ConfigItem = new ListSubItem(); ConfigItem.MainLabelText = Localize.Get(Strings.Config); ConfigItem.SubLabelVisibility = Visibility.Hidden; ConfigItem.Height = PerHeight; MW.OptionalView.Items.Add(ConfigItem); if (InstanceData.LogMode) { LogWindow = new LAP.Dialogs.LogWindow(); LogItem = new ListSubItem(); LogItem.MainLabelText = Localize.Get(Strings.Log); LogItem.SubLabelVisibility = Visibility.Hidden; LogItem.Height = PerHeight; MW.OptionalView.Items.Add(LogItem); } MW.OptionalView.Items.Add(new Separator()); CreatorItem = new ListSubItem(); CreatorItem.MainLabelText = Localize.Get(Strings.Creator); CreatorItem.SubLabelVisibility = Visibility.Hidden; CreatorItem.Height = PerHeight; MW.OptionalView.Items.Add(CreatorItem); MW.OptionalView.Items.Add(new Separator()); ExitItem = new ListSubItem(); ExitItem.MainLabelText = Localize.Get(Strings.Exit); ExitItem.SubLabelVisibility = Visibility.Hidden; ExitItem.Height = PerHeight; MW.OptionalView.Items.Add(ExitItem); double h = 0; for (int i = 0; MW.OptionalView.Items.Count > i; i++) { h += MW.OptionalView.Items[i].Height; } MW.OptionalGrid.Height = h; }
private ListItem CreateSubItem(Page.Playlist.Playlist.PlaylistData.Path Path) { ListAnimativeItem Lai = new ListAnimativeItem(true); Lai.DataType = typeof(Page.Playlist.Playlist.PlaylistData.Path); Lai.Data = Path; ListSubItem lsi = new ListSubItem(); Lai.ItemsHeight = lsi.Height; lsi.SubLabelVisibility = Visibility.Visible; lsi.SubLabelText = "Unknown"; switch (Path.IsFile) { case true: lsi.MainLabelText = System.IO.Path.GetFileName(Path.FilePath) + " - " + Utils.Config.Language.Strings.Path.File; lsi.SubLabelText = Path.FilePath; break; case false: lsi.MainLabelText = System.IO.Path.GetFileName(Path.DirectoryPath) + " - " + Utils.Config.Language.Strings.Path.Directory; lsi.SubLabelText = Path.DirectoryPath + " - Filter : " + string.Join(" , ", Path.Filter); break; } Lai.FirstItem = lsi; ListButtonsItem lbi = new ListButtonsItem(); ListButtonsItem.ListButton Remove = new ListButtonsItem.ListButton(Lai); Remove.Click += Remove_Click; Remove.Content = Utils.Config.Language.Strings.ContextMenu.Remove; lbi.Add(Remove); Lai.SecondItem = lbi; return(Lai); }