Exemple #1
0
 public MainWindow()
 {
     InitializeComponent();
     if (App.Profile != null)
     {
         DesktopMascot desktopMascot = new DesktopMascot(App.Profile, App.ProfilePath);
         desktopMascot.Show();
         Close();
     }
     _init = false;
 }
        void InitHandlers(DesktopMascot Window, Profile Profile, Mascot Mascot)
        {
            FollowItem.Click += (sender, e) => BehaviorChanged(Profile, MascotBehavior.Follow);
            WalkItem.Click   += (sender, e) => BehaviorChanged(Profile, MascotBehavior.Walk);
            StayItem.Click   += (sender, e) => BehaviorChanged(Profile, MascotBehavior.None);

            FollowItem.IsChecked = Profile.Behavior == MascotBehavior.Follow;
            WalkItem.IsChecked   = Profile.Behavior == MascotBehavior.Walk;
            StayItem.IsChecked   = Profile.Behavior == MascotBehavior.None;

            {
                LockMascotItem.IsChecked = Profile.Locked;
                CheckableAssociate(LockMascotItem, (c) =>
                {
                    Profile.Locked = c;
                    Window.MascotV.IsEnableRotation = !Profile.Locked;
                });
            }
            {
                CloseWindowItem.Click += (sender, e) => Window.Close();
            }
        }
 public MascotContextMenuManager(DesktopMascot Window, Profile Profile, Mascot Mascot)
 {
     SetMascot(Mascot);
     InitHandlers(Window, Profile, Mascot);
 }