コード例 #1
0
        private void ImageItemButton_DoubleClick(object sender, RoutedEventArgs e)
        {
            Uri       clickedPicture = (Uri)(sender as System.Windows.Controls.Button).Tag;
            PicWindow window         = new PicWindow(clickedPicture);
            Action    popWindow      = () => window.Show();

            this.Dispatcher.BeginInvoke(popWindow);
        }
コード例 #2
0
        private void OpenImageMenuItem_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog();

            ofd.Filter = "XML files (.jpg, .gif, .png) | *.jpg; *.gif; *.png";
            DialogResult result = ofd.ShowDialog();

            if (result == System.Windows.Forms.DialogResult.OK)
            {
                PicWindow newWindow = new PicWindow(ofd.FileName);
                newWindow.Show();
            }
        }