コード例 #1
0
        public static void Show(IEnumerable <ImagesViewerItemViewModel> items, ImagesViewerItemViewModel selected = null)
        {
            var owner = App.Current.Windows.OfType <Window>().FirstOrDefault(z => z.IsActive);
            var win   = new ImagesViewerWindow
            {
                DataContext = items,
                Owner       = owner
            };

            win.Show();
            win.ImagesViewerControl.FlipView.SelectedItem = selected;
        }
コード例 #2
0
 private void Image_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
 {
     if (e.ClickCount == 2)
     {
         var image = sender as Image;
         if (image == null)
         {
             return;
         }
         var uri = image.Tag as UriInfo;
         if (uri != null)
         {
             var items = this.items.Select(z => new ImagesViewerItemViewModel(z.Uri)
             {
                 Name = z.Name
             }).ToArray();
             ImagesViewerWindow.Show(items, items.FirstOrDefault(z => z.Uri == uri.Uri));
         }
     }
 }