Beispiel #1
0
        public MainWindow()
        {
            InitializeComponent();

            Color backgroundColor = new Color { A = 255, R = 249, G = 237, B = 78 };
            _flipbook = new Flipbook(backgroundColor);

            _flipbook.PageChanged += Flipbook_PageChanged;
            _flipbook.RefreshPage();

            _buttonsForColor = new List<Button>();
            foreach (Button b in ColorHistory.Children)
            {
                _buttonsForColor.Add(b);
            }
            UpdateNavigation();

            InitializeMenuEvents();
            BindCommands();

            sldrNavigation.ValueChanged += (sender, e) => _flipbook.MoveToPage(Convert.ToInt32(sldrNavigation.Value - 1));
            Closing += (sender, e) =>
            {
                if (_flipbook.HasUnsavedChanges &&
                    GetConfirmation("Unsaved Changes detected. Would you like to save before exiting?",
                        "Unsaved Changes") == true)
                {
                    Save();
                } 
            };
        }
Beispiel #2
0
 public ExportWindow(Flipbook flipbook)
 {
     InitializeComponent();
     _flipbook = flipbook;
     btnCancel.Click += (sender, e) => this.Close();
     FramePicker.Maximum = Convert.ToByte(flipbook.PageCount);
     FramePicker.Minimum = 1;
     PathText.Text = System.AppDomain.CurrentDomain.BaseDirectory + "myProject";
 }
Beispiel #3
0
        public Page(Flipbook parent)
        {
            _parent = parent;
            ClipToBounds = true;

            Background = parent.Brush;
            Drawings = new List<DrawingVisual>();

            _undoStack = new Stack<int>();
            _redoStack = new Stack<List<DrawingVisual>>();

            MouseDown += (sender, e) => Page_MouseDown(e.GetPosition(this));
            MouseMove += (sender, e) => Page_MouseMove(e.GetPosition(this));
            MouseUp += (sender, e) => Page_MouseUp(e.GetPosition(this));
            MouseLeave += (sender, e) => Page_MouseLeave(e.GetPosition(this));
        }