Пример #1
0
        private void Image_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            if (sender as Image != null && (sender as Image).DataContext as String != null)
            {
                ImageViewWindow childWnd = new ImageViewWindow((sender as Image).DataContext.ToString());
                childWnd.Show();

                //Image container = (Image)sender;

                childWnd.Activate();
                childWnd.Focus();
                childWnd.Topmost = true;


                // this.AddChild(childWnd);

                //childWnd.BringIntoView();
            }
        }
        private void Image_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            if (sender as Image != null && (sender as Image).DataContext as String != null)
            {
                ImageViewWindow childWnd = new ImageViewWindow((sender as Image).DataContext.ToString());
                childWnd.Show();

                //Image container = (Image)sender;

                childWnd.Activate();
                childWnd.Focus();
                childWnd.Topmost = true;


                // this.AddChild(childWnd);

                //childWnd.BringIntoView();
            }

            else if (sender as Image != null && (sender as Image).Source != null)
            {
                Base64ImageConverter base64Image = new Base64ImageConverter();

                string base64string = (string)base64Image.ConvertBack((sender as Image).Source, null, null, null);

                ImageViewWindow childWnd = new ImageViewWindow(base64string, true);
                childWnd.Show();

                //Image container = (Image)sender;

                childWnd.Activate();
                childWnd.Focus();
                childWnd.Topmost = true;


                // this.AddChild(childWnd);

                //childWnd.BringIntoView();
            }
        }