Esempio n. 1
0
        private void WCRecentsLoad()
        {
            WCRecentContainer.Children.RemoveRange(2, WCRecentContainer.Children.Count - 1);

            var recentFiles       = VoltaSettings.RecentFiles;
            var existsRecentFiles = recentFiles != null && 0 < recentFiles.Count;

            (WCRecentContainer.Children[1] as FrameworkElement).Visibility = !existsRecentFiles ? Visibility.Visible : Visibility.Collapsed;

            if (existsRecentFiles)
            {
                foreach (var rf in recentFiles)
                {
                    var item = new TextBlock {
                        Style = WC.FindResource("Style.ActionLabel") as Style,
                        Tag   = $"recent {rf}",
                        Text  = rf
                    };
                    item.MouseLeftButtonDown += WCDoAction;
                    WCRecentContainer.Children.Add(item);
                }
            }
        }