public SaveDialog(SessionManager _sessionManager, Main _instance) { InitializeComponent(); sessionManager = _sessionManager; instance = _instance; }
// REFACTOR THIS TO A STATIC CLASS public DrawingCanvasHelper(SessionManager _activeSessionManager, InkCanvas _PageInkCanvas, ScatterView _Container, Ellipse _CurrentColor, Image _ColorWheel) { this.ActiveSessionManager = _activeSessionManager; this.PageInkCanvas = _PageInkCanvas; this.Container = _Container; this.CurrentColor = _CurrentColor; this.ColorWheel = _ColorWheel; }
public NavigationPageDialog(PrototypeElement _instance, SessionManager _sessionManager, string _gesture, Label _behaviorLabel) { InitializeComponent(); gesture = _gesture; const string gestureContent = "Use {0} to navigate to page:"; Title.Content = String.Format(gestureContent, gesture); sessionManager = _sessionManager; instance = _instance; PagesListBox.SetBinding(SurfaceListBox.ItemsSourceProperty, new Binding() { Source = _sessionManager.CurrentProject.PageDictionary.ValueObservableCollection }); behaviorLabel = _behaviorLabel; }
//"*.asgproj" public LoadDialog(SessionManager _sessionManager, Main _instance,List<string> _filter, LoadDialogType _type, ScatterViewItem svi = null) { InitializeComponent(); sessionManager = _sessionManager; instance = _instance; type = _type; DirectoryInfo di = null; switch (type) { case LoadDialogType.Project: di = new DirectoryInfo(EnvironmentFolder.getProjectsFolder()); LoadButton.Click += LoadProjectButton_Click; Title.Content = "LOAD PROJECT"; break; case LoadDialogType.BackgroundImage: di = new DirectoryInfo(EnvironmentFolder.getImagesFolder()); LoadButton.Click += LoadImageButton_Click; Title.Content = "BACKGROUND IMAGE"; break; case LoadDialogType.GestureAreaImage: di = new DirectoryInfo(EnvironmentFolder.getImagesFolder()); Svi = svi; LoadButton.Click += LoadImageGestureAreaButton_Click; Title.Content = "GESTURE AREA IMAGE"; break; } ProjectList.Items.Clear(); foreach (string s in _filter) { FileInfo[] rgFiles = di.GetFiles(s); foreach (FileInfo fi in rgFiles) { ProjectList.Items.Add(fi.Name); } } }
private void CreateASG(Canvas root) { ActiveSessionManager = new SessionManager(PageInkCanvas, root); canvasHelper = new DrawingCanvasHelper(ActiveSessionManager, PageInkCanvas, Container, CurrentColor,ColorWheel); this.mainCanvasRoot = root; events = new EventsGesture(this); thumbnails = new Thumbnails(this); CanvasItem.Height = root.Height - 50; CanvasItem.Width = root.Width - 50; TextContainer.Center = new Point((double)root.Width / 2, (double)root.Height / 2); CanvasItem.Center = new Point((double)root.Width / 2, (double)root.Height / 2); TrashContainer.Center = new Point((double)root.Width - 30, (double)root.Height / 2); TrashContainer.Height = root.Height; TrashContainer.Width = 50; LeftMenu.Width = 50; LeftMenu.Center = new Point(10, (double)root.Height / 2.2); LeftMenu.Height = root.Height/1.5; TopMenu.Width = root.Width - 50 ; TopMenu.Center = new Point((double)root.Width / 2 , 25 ); TopMenu.Height = 50; BottomMenu.Width = root.Width; BottomMenu.Height = 50; BottomMenu.Center = new Point((double)root.Width / 2 + 50, root.Height - 25); PageInkCanvas.Height = root.Height; PageInkCanvas.Width = root.Width; RemovingItemsShadow(); TextContainer.Visibility = Visibility.Hidden; timerMessage = new DispatcherTimer(); PageInkCanvas.ReleaseAllCaptures(); canvasHelper.loadPenSettings(); SetFontSize(root); }