/// <summary> /// アプリケーション起動時処理 /// トレイアイコンとかの生成 /// </summary> /// <param name="e"></param> protected override async void OnStartup(StartupEventArgs e) { base.OnStartup(e); LoadConfiguration(); this.ShutdownMode = ShutdownMode.OnExplicitShutdown; this.notifyIcon = new NotifyIconWrapper(); List <Pose> poses = new List <Pose>(); for (int i = 0; i < 6; i++) { ImagePair imagePair = ImagePairLoader.Load(@"C:\Sync\gif\irisu\3px\rabiribi_iris_page" + (i + 1) + ".png"); Pose pose = new Pose(imagePair, 6); poses.Add(pose); } Animation animation = new Animation(poses.ToArray()); Mascot mascot = new Mascot(animation); MascotView view = new MascotView(mascot); view.Show(); var token = CancellationToken.None; while (true) { await Task.WhenAll(Task.Delay(1), Task.Run(() => { mascot.Tick(); }, token)); } //CreateFirst(); }
public MascotView(Mascot mascot) { //常時最前面 Topmost = true; //マウスドラッグ出来るように MouseLeftButtonDown += (sender, e) => DragMove(); InitializeComponent(); ((MascotViewModel)DataContext).Init(mascot); }
public void Next(Mascot mascot) { mascot.ImageData = ImagePair.GetImage(mascot.IsLookRight); }
public void Next(int time, Mascot mascot) { GetPoseAtTime(time).Next(mascot); }