Example #1
0
        public ServerViewModel(IHttpHandler handler)
        {
            this.Handler = handler;

            PageTitle = "Photon Server";

            Master = new MasterVM();
        }
Example #2
0
        public AgentViewModel(IHttpHandler handler)
        {
            this.Handler = handler;

            PageTitle = "Photon Agent";

            Master = new MasterVM();
        }
 /// <summary>
 /// This method fires when the mouse is moved in the canvas.
 /// </summary>
 /// <param name="sender"> The object sender. </param>
 /// <param name="e"> The event args. </param>
 private void Canvas_MouseMove(object sender, System.Windows.Input.MouseEventArgs e)
 {
     if (e.LeftButton == System.Windows.Input.MouseButtonState.Pressed)
     {
         MasterVM mVM = (MasterVM)this.DataContext;
         mVM.ZoomVM.GetWidthAndHeight(e.GetPosition((Canvas)sender));
     }
 }
Example #4
0
        public ServerViewModelAsync(IHttpHandler handler)
        {
            this.Handler = handler;

            PageTitle = "Photon Server";

            Master          = new MasterVM();
            SecurityEnabled = PhotonServer.Instance.ServerConfiguration.Value.Security?.Enabled ?? false;
        }
        /// <summary>
        /// This method fires when the mouse is clicked in the canvas.
        /// </summary>
        /// <param name="sender"> The object sender. </param>
        /// <param name="e"> The event args. </param>
        private void Canvas_MouseUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            MasterVM mVM = (MasterVM)this.DataContext;

            mVM.ZoomVM.ScaleAxis(e.GetPosition((Canvas)sender));
        }
Example #6
0
        //Update the property view after selection changed
        void UpdatePropertyView()
        {
            List <WidgetViewModBase> Widgets = _model.GetSelectionWidget();

            Property.ImagePropertyViewModel       ImageVM       = null;
            Property.LinkPropertyViewModel        LinkVM        = null;
            Property.TextPropertyViewModel        LableVM       = null;
            Property.ShapePropertyViewModel       ShapeVM       = null;
            Property.GroupPropertyViewModel       GroupVM       = null;
            Property.ListBoxPropertyViewModel     ListboxVM     = null;
            Property.DropListPropertyViewModel    DroplistVM    = null;
            Property.CheckBoxPropertyViewModel    CheckboxVM    = null;
            Property.RadioButtonPropertyViewModel RadioButtonVM = null;
            Property.TextAreaPropertyViewModel    TextareaVM    = null;
            Property.TextFieldPropertyViewModel   TextFieldVM   = null;
            Property.ButtonPropertyViewModel      ButtonVM      = null;
            Property.HamburgerPropertyViewModel   HamburgerVM   = null;
            Property.FlickPannelPropertyViewModel FlickpannelVM = null;
            Property.ToastPropertyViewModel       ToastVM       = null;
            Property.SVGPropertyViewModel         SVGVM         = null;
            Property.MasterPropertyViewModel      MasterVM      = null;
            Items.Clear();

            foreach (WidgetViewModBase data in Widgets)
            {
                if (data.IsGroup)
                {
                    if (GroupVM == null)
                    {
                        GroupVM = new Property.GroupPropertyViewModel();
                        Items.Add(GroupVM);
                    }

                    GroupVM.AddItems(data);
                }
                else if (data.WidgetType == WidgetType.Image)
                {
                    if (ImageVM == null)
                    {
                        ImageVM = new Property.ImagePropertyViewModel();
                        Items.Add(ImageVM);
                    }

                    ImageVM.AddItems(data);
                }
                else if (data.WidgetType == WidgetType.HotSpot)
                {
                    if (LinkVM == null)
                    {
                        LinkVM = new Property.LinkPropertyViewModel();
                        Items.Add(LinkVM);
                    }

                    LinkVM.AddItems(data);
                }
                else if (data.WidgetType == WidgetType.Shape && data.shapetype == ShapeType.Paragraph)
                {
                    if (LableVM == null)
                    {
                        LableVM = new Property.TextPropertyViewModel();
                        Items.Add(LableVM);
                    }

                    LableVM.AddItems(data);
                }

                else if (data.WidgetType == WidgetType.ListBox)
                {
                    if (ListboxVM == null)
                    {
                        ListboxVM = new Property.ListBoxPropertyViewModel();
                        Items.Add(ListboxVM);
                    }

                    ListboxVM.AddItems(data);
                }
                else if (data.WidgetType == WidgetType.DropList)
                {
                    if (DroplistVM == null)
                    {
                        DroplistVM = new Property.DropListPropertyViewModel();
                        Items.Add(DroplistVM);
                    }

                    DroplistVM.AddItems(data);
                }
                else if (data.WidgetType == WidgetType.Checkbox)
                {
                    if (CheckboxVM == null)
                    {
                        CheckboxVM = new Property.CheckBoxPropertyViewModel();
                        Items.Add(CheckboxVM);
                    }

                    CheckboxVM.AddItems(data);
                }
                else if (data.WidgetType == WidgetType.RadioButton)
                {
                    if (RadioButtonVM == null)
                    {
                        RadioButtonVM = new Property.RadioButtonPropertyViewModel();
                        Items.Add(RadioButtonVM);
                    }

                    RadioButtonVM.AddItems(data);
                }
                else if (data.WidgetType == WidgetType.TextArea)
                {
                    if (TextareaVM == null)
                    {
                        TextareaVM = new Property.TextAreaPropertyViewModel();
                        Items.Add(TextareaVM);
                    }
                    TextareaVM.AddItems(data);
                }
                else if (data.WidgetType == WidgetType.TextField)
                {
                    if (TextFieldVM == null)
                    {
                        TextFieldVM = new Property.TextFieldPropertyViewModel();
                        Items.Add(TextFieldVM);
                    }
                    TextFieldVM.AddItems(data);
                }
                else if (data.WidgetType == WidgetType.Button)
                {
                    if (ButtonVM == null)
                    {
                        ButtonVM = new Property.ButtonPropertyViewModel();
                        Items.Add(ButtonVM);
                    }
                    ButtonVM.AddItems(data);
                }

                else if (data.WidgetType == WidgetType.Shape &&
                         (data.shapetype == ShapeType.Rectangle ||
                          data.shapetype == ShapeType.RoundedRectangle ||
                          data.shapetype == ShapeType.Ellipse ||
                          data.shapetype == ShapeType.Diamond ||
                          data.shapetype == ShapeType.Triangle))
                {
                    if (ShapeVM == null)
                    {
                        ShapeVM = new Property.ShapePropertyViewModel();
                        Items.Add(ShapeVM);
                    }

                    ShapeVM.AddItems(data);
                }
                else if (data.WidgetType == WidgetType.HamburgerMenu)
                {
                    if (HamburgerVM == null)
                    {
                        HamburgerVM = new Property.HamburgerPropertyViewModel();
                        Items.Add(HamburgerVM);
                    }

                    HamburgerVM.AddItems(data);
                }
                else if (data.WidgetType == WidgetType.DynamicPanel)
                {
                    if (FlickpannelVM == null)
                    {
                        FlickpannelVM = new Property.FlickPannelPropertyViewModel();
                        Items.Add(FlickpannelVM);
                    }

                    FlickpannelVM.AddItems(data);
                }
                else if (data.WidgetType == WidgetType.Toast)
                {
                    if (ToastVM == null)
                    {
                        ToastVM = new Property.ToastPropertyViewModel();
                        items.Add(ToastVM);
                    }
                    ToastVM.AddItems(data);
                }
                else if (data.WidgetType == WidgetType.SVG)
                {
                    if (SVGVM == null)
                    {
                        SVGVM = new Property.SVGPropertyViewModel();
                        items.Add(SVGVM);
                    }
                    SVGVM.AddItems(data);
                }
                else if (data is MasterWidgetViewModel)
                {
                    if (MasterVM == null)
                    {
                        MasterVM = new Property.MasterPropertyViewModel();
                        items.Add(MasterVM);
                    }
                    MasterVM.AddItems(data);
                }
            }
            FirePropertyChanged("Items");
        }
Example #7
0
        private async void LoadInformation()
        {
            await MasterVM.GetElementList();

            Bindings.Update();
        }