Untitled

 avatar
unknown
plain_text
5 months ago
1.1 kB
3
Indexable
using System;
using System.Windows;
using System.Windows.Input;
using System.Windows.Media.Imaging;

namespace YourNamespace
{
    public partial class MainWindow : Window
    {
        private string bigImage1Path = @"C:\Path\To\BigImage1.png";
        private string bigImage2Path = @"C:\Path\To\BigImage2.png";

        public MainWindow()
        {
            InitializeComponent();

            // Initialize the small toggleable image
            SmallToggleImage.FirstImagePath = @"C:\Path\To\SmallImage1.png";
            SmallToggleImage.SecondImagePath = @"C:\Path\To\SmallImage2.png";
            SmallToggleImage.SetInitialImage(SmallToggleImage.FirstImagePath);
        }

        private void BigImage_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            // Single-click functionality (optional, leave empty if not needed)
        }

        private void BigImage_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            // Change the small toggleable image on double-click
            SmallToggleImage.SetImageSource(SmallToggleImage.SecondImagePath);
        }
    }
}
Editor is loading...
Leave a Comment