protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); if (e.Parameter != null) { var param = e.Parameter; if (param.ToString().Equals((typeof(PictureListInfo)).ToString())) { PictureListInfo info = param as PictureListInfo; image.Source = info.picture; filePath = info.picturePath; this.info = info; } stage = GLOABOALSTAGE.EDITPAGE_CROP; } }
private void menuList_SelectionChanged(object sender, SelectionChangedEventArgs e) { editMenuGrid.Visibility = Visibility.Visible; menuList.Visibility = Visibility.Collapsed; foreach (var item in ListBoxItemMapping) { if (item.Key.Equals((sender as ListBox).SelectedItem)) { item.Value.Visibility = Visibility.Visible; } else { item.Value.Visibility = Visibility.Collapsed; } } if (stageMapping.ContainsKey((sender as ListBox).SelectedItem as ListBoxItem)) { stage = stageMapping[(sender as ListBox).SelectedItem as ListBoxItem]; switch (stage) { case GLOABOALSTAGE.EDITPAGE_ROTATE: ResetImage(); break; case GLOABOALSTAGE.EDITPAGE_CROP: ResetCrop(); break; case GLOABOALSTAGE.EDITPAGE_INK: ResetInk(); break; case GLOABOALSTAGE.EDITPAGE_TEXT: ResetText(); break; default: break; } } }
private void menuList_SelectionChanged(object sender, SelectionChangedEventArgs e) { foreach (var item in ListBoxItemMapping) { if (item.Key.Equals((sender as ListBox).SelectedItem)) { item.Value.Visibility = Visibility.Visible; } else { item.Value.Visibility = Visibility.Collapsed; } } //if (stage == GLOABOALSTAGE.EDITPAGE_ROTATE) //{ // stage = stageMapping[(sender as ListBox).SelectedItem as ListBoxItem]; // if (add) // { // this.Width += 1; // add = false; // } // else // { // this.Width -= 1; // add = true; // } // return; //} if (stageMapping.ContainsKey((sender as ListBox).SelectedItem as ListBoxItem)) { stage = stageMapping[(sender as ListBox).SelectedItem as ListBoxItem]; switch(stage) { case GLOABOALSTAGE.EDITPAGE_ROTATE: ResetImage(); break; case GLOABOALSTAGE.EDITPAGE_CROP: ResetCrop(); break; case GLOABOALSTAGE.EDITPAGE_INK: ResetInk(); break; case GLOABOALSTAGE.EDITPAGE_TEXT: ResetText(); break; default: break; } } }
private void pictureGrid_SelectionChanged(object sender, SelectionChangedEventArgs e) { pictureGrid.Visibility = Visibility.Collapsed; selectedIndex = pictureFlipview.SelectedIndex = pictureGrid.SelectedIndex; pictureFlipview.Visibility = Visibility.Visible; stage = GLOABOALSTAGE.MAINPAGE_PICFLIP; }
protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); if (e.Parameter != null) { var param = e.Parameter; if (param.ToString().Equals((typeof(PictureListInfo)).ToString())) { PictureListInfo info = param as PictureListInfo; image.Source = info.picture; filePath = info.picturePath; this.info = info; } else if (param.ToString().Equals((typeof(PageNavigateParam)).ToString())) { isProjected = true; PageNavigateParam projectParam = param as PageNavigateParam; mainViewId = projectParam.MainViewId; //thisViewControl = projectParam.ProjectionViewPageControl; //mainDispatcher = projectParam.MainDispatcher; //thisViewControl.Released += ThisViewControl_Released; GLOABOALSTAGE stageProjected = projectParam.stage; if(stageProjected != GLOABOALSTAGE.EDITPAGE_INK) { monitorTimer = new DispatcherTimer(); monitorTimer.Interval = new TimeSpan(0, 0, 2); monitorTimer.Tick += MonitorTimer_Tick; monitorTimer.Start(); } switch (stageProjected) { case GLOABOALSTAGE.EDITPAGE_CROP: cropParam = projectParam.stageParam as CropStateParam; this.info = cropParam.PicInfo; filePath = info.picturePath; break; case GLOABOALSTAGE.EDITPAGE_ROTATE: RotateStateParam rotateParam = projectParam.stageParam as RotateStateParam; this.info = rotateParam.PicInfo; filePath = info.picturePath; stage = GLOABOALSTAGE.EDITPAGE_ROTATE; m_userRotation = rotateParam.UserRotation; break; case GLOABOALSTAGE.EDITPAGE_INK: InkStateParam inkParam = projectParam.stageParam as InkStateParam; this.info = inkParam.PicInfo; filePath = info.picturePath; stage = GLOABOALSTAGE.EDITPAGE_INK; //((App)App.Current).SyncStrokeEx(strokeMapping, true); ink.Visibility = Visibility.Visible; break; case GLOABOALSTAGE.EDITPAGE_TEXT: TextStateParam textParam = projectParam.stageParam as TextStateParam; this.info = textParam.PicInfo; filePath = info.picturePath; stage = GLOABOALSTAGE.EDITPAGE_TEXT; break; } } } }