예제 #1
0
        ConnectorViewModel AddConnector(Point sp, Point ep, StyleId styleid)
        {
            ConnectorViewModel connector = new ConnectorViewModel()
            {
                SourcePoint            = sp,
                TargetPoint            = ep,
                ThemeStyleId           = styleid,
                ConnectorGeometryStyle = App.Current.Resources["geometryStyle"] as Style
            };

            connector.Annotations = new ObservableCollection <IAnnotation>()
            {
                new TextAnnotationViewModel()
                {
                    Text = styleid.ToString()
                           //Content = new TextSettings()
                           //{
                           //    Text = styleid.ToString()
                           //},
                           // ViewTemplate = this.Resources["viewTemplate"] as DataTemplate
                }
            };
            (sfdiagram.Connectors as ObservableCollection <ConnectorViewModel>).Add(connector);
            return(connector);
        }
예제 #2
0
        NodeViewModel AddNode(double offx, double offy, StyleId styleid)
        {
            NodeViewModel node = new NodeViewModel()
            {
                OffsetX      = offx,
                OffsetY      = offy,
                UnitWidth    = 75,
                UnitHeight   = 75,
                Shape        = App.Current.Resources["Rectangle"],
                ShapeStyle   = App.Current.Resources["shapeStyle"] as Style,
                ThemeStyleId = styleid,
            };

            node.Annotations = new ObservableCollection <IAnnotation>()
            {
                new TextAnnotationViewModel()
                {
                    //Content = new TextSettings()
                    //{
                    //    Text = styleid.ToString()
                    //},
                    // ViewTemplate = this.Resources["viewTemplate"] as DataTemplate
                    Text         = styleid.ToString(),
                    TextWrapping = TextWrapping.Wrap,
                }
            };
            (sfdiagram.Nodes as ObservableCollection <NodeViewModel>).Add(node);
            return(node);
        }
예제 #3
0
        /// <summary>
        /// Create and add the connector to the connector collection.
        /// </summary>
        /// <param name="spoint">Sourcepoint of the connector</param>
        /// <param name="tpoint">Targetpoint of the connector</param>
        /// <param name="styleid">ThemestyleId</param>
        /// <returns></returns>
        ConnectorViewModel AddConnector(Point spoint, Point tpoint, StyleId styleid)
        {
            ConnectorViewModel connector = new ConnectorViewModel()
            {
                SourcePoint            = spoint,
                TargetPoint            = tpoint,
                ThemeStyleId           = styleid,
                ConnectorGeometryStyle = View.Resources["geometryStyle"] as Style
            };

            connector.Annotations = new ObservableCollection <IAnnotation>()
            {
                new TextAnnotationViewModel()
                {
                    Text = styleid.ToString()
                }
            };
            (this.Connectors as ObservableCollection <ConnectorViewModel>).Add(connector);
            return(connector);
        }
예제 #4
0
        /// <summary>
        /// Create and add the Node to the Nodes collection.
        /// </summary>
        /// <param name="offsetx">specifies the offsetx of the Node</param>
        /// <param name="offsety">specifies the offsety of the Node</param>
        /// <param name="styleid">ThemestyleId</param>
        /// <returns></returns>
        NodeViewModel AddNode(double offsetx, double offsety, StyleId styleid)
        {
            NodeViewModel node = new NodeViewModel()
            {
                OffsetX      = offsetx,
                OffsetY      = offsety,
                UnitWidth    = 75,
                UnitHeight   = 75,
                Shape        = resourceDictionary["Rectangle"],
                ShapeStyle   = View.Resources["shapeStyle"] as Style,
                ThemeStyleId = styleid,
            };

            node.Annotations = new ObservableCollection <IAnnotation>()
            {
                new TextAnnotationViewModel()
                {
                    Text         = styleid.ToString(),
                    TextWrapping = TextWrapping.Wrap,
                }
            };
            (this.Nodes as ObservableCollection <NodeViewModel>).Add(node);
            return(node);
        }
예제 #5
0
파일: Editor.cs 프로젝트: pranart/FormTest
        public string Get(string propertyName)
        {
            switch (propertyName)
            {
            //ELEMENT
            case nameof(ClassId):
                return(ClassId.ToString());

            case nameof(AutomationId):
                return(AutomationId.ToString());

            case nameof(Id):
                return(Id.ToString());

            case nameof(StyleId):
                return(StyleId.ToString());

            //VISUAL ELEMENT
            case nameof(AnchorX):
                return(AnchorX.ToString());

            case nameof(AnchorY):
                return(AnchorY.ToString());

            case nameof(BackgroundColor):
                return(BackgroundColor.ToHex());

            case nameof(Width):
                return(this.Width.ToString());

            case nameof(Height):
                return(this.Height.ToString());

            case nameof(IsEnabled):
                return(IsEnabled.ToString());

            case nameof(WidthRequest):
                return(this.WidthRequest.ToString());

            case nameof(HeightRequest):
                return(this.HeightRequest.ToString());

            case nameof(IsFocused):
                return(IsFocused.ToString());

            case nameof(IsVisible):
                return(IsVisible.ToString());

            case nameof(InputTransparent):
                return(InputTransparent.ToString());

            case nameof(X):
                return(this.X.ToString());

            case nameof(Y):
                return(this.Y.ToString());

            case nameof(Opacity):
                return(this.Opacity.ToString());

            case nameof(TranslationX):
                return(this.TranslationX.ToString());

            case nameof(TranslationY):
                return(this.TranslationY.ToString());

            case nameof(Rotation):
                return(this.Rotation.ToString());

            case nameof(RotationX):
                return(this.RotationX.ToString());

            case nameof(RotationY):
                return(this.RotationY.ToString());

            case nameof(Scale):
                return(this.Scale.ToString());

            //VIEW
            case nameof(Margin):
                return(this.Margin.ToString());

            case nameof(VerticalOptions):
                return(this.VerticalOptions.ToString());

            case nameof(HorizontalOptions):
                return(this.HorizontalOptions.ToString());

            //INPUTVIEW
            case nameof(Keyboard):
                return(this.Keyboard.ToString());

            //EDITOR
            case nameof(FontAttributes):
                return(this.FontAttributes.ToString());

            case nameof(FontFamily):
                return(this.FontFamily);

            case nameof(FontSize):
                return(this.FontSize.ToString());

            case nameof(Text):
                return(this.Text);

            case nameof(TextColor):
                return(this.TextColor.ToHex());

            default:
                return(string.Empty);
            }
        }
예제 #6
0
        public string Get(string propertyName)
        {
            switch (propertyName)
            {
            //ELEMENT
            case nameof(ClassId):
                return(ClassId.ToString());

            case nameof(AutomationId):
                return(AutomationId.ToString());

            case nameof(Id):
                return(Id.ToString());

            case nameof(StyleId):
                return(StyleId.ToString());

            //VISUAL ELEMENT
            case nameof(AnchorX):
                return(AnchorX.ToString());

            case nameof(AnchorY):
                return(AnchorY.ToString());

            case nameof(BackgroundColor):
                return(BackgroundColor.ToHex());

            case nameof(Width):
                return(this.Width.ToString());

            case nameof(Height):
                return(this.Height.ToString());

            case nameof(IsEnabled):
                return(IsEnabled.ToString());

            case nameof(WidthRequest):
                return(this.WidthRequest.ToString());

            case nameof(HeightRequest):
                return(this.HeightRequest.ToString());

            case nameof(IsFocused):
                return(IsFocused.ToString());

            case nameof(IsVisible):
                return(IsVisible.ToString());

            case nameof(InputTransparent):
                return(InputTransparent.ToString());

            case nameof(X):
                return(this.X.ToString());

            case nameof(Y):
                return(this.Y.ToString());

            case nameof(Opacity):
                return(this.Opacity.ToString());

            case nameof(TranslationX):
                return(this.TranslationX.ToString());

            case nameof(TranslationY):
                return(this.TranslationY.ToString());

            case nameof(Rotation):
                return(this.Rotation.ToString());

            case nameof(RotationX):
                return(this.RotationX.ToString());

            case nameof(RotationY):
                return(this.RotationY.ToString());

            case nameof(Scale):
                return(this.Scale.ToString());

            //VIEW
            case nameof(Margin):
                return(this.Margin.ToString());

            case nameof(VerticalOptions):
                return(this.VerticalOptions.ToString());

            case nameof(HorizontalOptions):
                return(this.HorizontalOptions.ToString());

            //STEPPER
            case nameof(Maximum):
                return(Maximum.ToString());

            case nameof(Minimum):
                return(Minimum.ToString());

            case nameof(Value):
                return(Value.ToString());

            case nameof(Increment):
                return(Increment.ToString());

            default:
                return(string.Empty);
            }
        }
예제 #7
0
파일: Picker.cs 프로젝트: pranart/FormsTest
        public string Get(string propertyName)
        {
            switch (propertyName)
            {
            //ELEMENT
            case nameof(ClassId):
                return(ClassId.ToString());

            case nameof(AutomationId):
                return(AutomationId.ToString());

            case nameof(Id):
                return(Id.ToString());

            case nameof(StyleId):
                return(StyleId.ToString());

            //VISUAL ELEMENT
            case nameof(AnchorX):
                return(AnchorX.ToString());

            case nameof(AnchorY):
                return(AnchorY.ToString());

            case nameof(BackgroundColor):
                return(BackgroundColor.ToHex());

            case nameof(Width):
                return(this.Width.ToString());

            case nameof(Height):
                return(this.Height.ToString());

            case nameof(IsEnabled):
                return(IsEnabled.ToString());

            case nameof(WidthRequest):
                return(this.WidthRequest.ToString());

            case nameof(HeightRequest):
                return(this.HeightRequest.ToString());

            case nameof(IsFocused):
                return(IsFocused.ToString());

            case nameof(IsVisible):
                return(IsVisible.ToString());

            case nameof(InputTransparent):
                return(InputTransparent.ToString());

            case nameof(X):
                return(this.X.ToString());

            case nameof(Y):
                return(this.Y.ToString());

            case nameof(Opacity):
                return(this.Opacity.ToString());

            case nameof(TranslationX):
                return(this.TranslationX.ToString());

            case nameof(TranslationY):
                return(this.TranslationY.ToString());

            case nameof(Rotation):
                return(this.Rotation.ToString());

            case nameof(RotationX):
                return(this.RotationX.ToString());

            case nameof(RotationY):
                return(this.RotationY.ToString());

            case nameof(Scale):
                return(this.Scale.ToString());

            //VIEW
            case nameof(Margin):
                return(this.Margin.ToString());

            case nameof(VerticalOptions):
                return(this.VerticalOptions.ToString());

            case nameof(HorizontalOptions):
                return(this.HorizontalOptions.ToString());

            //PICKER
            case nameof(ItemsSource):
                return(ItemsSource.OfType <object>().Select(x => x.ToString()).Aggregate((x, y) => x + "," + y));

            case nameof(SelectedItem):
                return(SelectedItem.ToString());

            case nameof(SelectedIndex):
                return(SelectedIndex.ToString());

            case nameof(Items):
                return(Items.Aggregate((x, y) => x + "," + y));

            case nameof(Title):
                return(Title);

            default:
                return(string.Empty);
            }
        }
예제 #8
0
        public string Get(string propertyName)
        {
            switch (propertyName)
            {
            //ELEMENT
            case nameof(ClassId):
                return(ClassId.ToString());

            case nameof(AutomationId):
                return(AutomationId.ToString());

            case nameof(Id):
                return(Id.ToString());

            case nameof(StyleId):
                return(StyleId.ToString());

            //VISUAL ELEMENT
            case nameof(AnchorX):
                return(AnchorX.ToString());

            case nameof(AnchorY):
                return(AnchorY.ToString());

            case nameof(BackgroundColor):
                return(BackgroundColor.ToHex());

            case nameof(Width):
                return(this.Width.ToString());

            case nameof(Height):
                return(this.Height.ToString());

            case nameof(IsEnabled):
                return(IsEnabled.ToString());

            case nameof(WidthRequest):
                return(this.WidthRequest.ToString());

            case nameof(HeightRequest):
                return(this.HeightRequest.ToString());

            case nameof(IsFocused):
                return(IsFocused.ToString());

            case nameof(IsVisible):
                return(IsVisible.ToString());

            case nameof(InputTransparent):
                return(InputTransparent.ToString());

            case nameof(X):
                return(this.X.ToString());

            case nameof(Y):
                return(this.Y.ToString());

            case nameof(Opacity):
                return(this.Opacity.ToString());

            case nameof(TranslationX):
                return(this.TranslationX.ToString());

            case nameof(TranslationY):
                return(this.TranslationY.ToString());

            case nameof(Rotation):
                return(this.Rotation.ToString());

            case nameof(RotationX):
                return(this.RotationX.ToString());

            case nameof(RotationY):
                return(this.RotationY.ToString());

            case nameof(Scale):
                return(this.Scale.ToString());

            //VIEW
            case nameof(Margin):
                return(this.Margin.ToString());

            case nameof(VerticalOptions):
                return(this.VerticalOptions.ToString());

            case nameof(HorizontalOptions):
                return(this.HorizontalOptions.ToString());

            //ITEMSVIEW
            case nameof(ItemsSource):
                return(ItemsSource.OfType <object>().Select(x => x.ToString()).Aggregate((x, y) => x + "," + y));

            //LISTVIEW
            case nameof(HasUnevenRows):
                return(HasUnevenRows.ToString());

            case nameof(IsGroupingEnabled):
                return(IsGroupingEnabled.ToString());

            case nameof(RowHeight):
                return(RowHeight.ToString());

            case nameof(Footer):
                return(Footer.ToString());

            case nameof(Header):
                return(Header.ToString());

            case nameof(IsPullToRefreshEnabled):
                return(IsPullToRefreshEnabled.ToString());

            case nameof(IsRefreshing):
                return(IsRefreshing.ToString());

            case nameof(SelectedItem):
                return(SelectedItem.ToString());

            case nameof(SeparatorColor):
                return(SeparatorColor.ToHex());

            case nameof(this.SeparatorVisibility):
                return(SeparatorVisibility.ToString());

            default:
                return(string.Empty);
            }
        }
예제 #9
0
        public string Get(string propertyName)
        {
            switch (propertyName)
            {
            //ELEMENT
            case nameof(ClassId):
                return(ClassId.ToString());

            case nameof(AutomationId):
                return(AutomationId.ToString());

            case nameof(Id):
                return(Id.ToString());

            case nameof(StyleId):
                return(StyleId.ToString());

            //VISUAL ELEMENT
            case nameof(AnchorX):
                return(AnchorX.ToString());

            case nameof(AnchorY):
                return(AnchorY.ToString());

            case nameof(BackgroundColor):
                return(BackgroundColor.ToHex());

            case nameof(Width):
                return(this.Width.ToString());

            case nameof(Height):
                return(this.Height.ToString());

            case nameof(IsEnabled):
                return(IsEnabled.ToString());

            case nameof(WidthRequest):
                return(this.WidthRequest.ToString());

            case nameof(HeightRequest):
                return(this.HeightRequest.ToString());

            case nameof(IsFocused):
                return(IsFocused.ToString());

            case nameof(IsVisible):
                return(IsVisible.ToString());

            case nameof(InputTransparent):
                return(InputTransparent.ToString());

            case nameof(X):
                return(this.X.ToString());

            case nameof(Y):
                return(this.Y.ToString());

            case nameof(Opacity):
                return(this.Opacity.ToString());

            case nameof(TranslationX):
                return(this.TranslationX.ToString());

            case nameof(TranslationY):
                return(this.TranslationY.ToString());

            case nameof(Rotation):
                return(this.Rotation.ToString());

            case nameof(RotationX):
                return(this.RotationX.ToString());

            case nameof(RotationY):
                return(this.RotationY.ToString());

            case nameof(Scale):
                return(this.Scale.ToString());

            //VIEW
            case nameof(Margin):
                return(this.Margin.ToString());

            case nameof(VerticalOptions):
                return(this.VerticalOptions.ToString());

            case nameof(HorizontalOptions):
                return(this.HorizontalOptions.ToString());

            //SEARCHBAR
            case nameof(CancelButtonColor):
                return(this.CancelButtonColor.ToHex());

            case nameof(Placeholder):
                return(this.Placeholder);

            case nameof(SearchCommandParameter):
                return(SearchCommandParameter.ToString());

            case nameof(Text):
                return(Text);

            default:
                return(string.Empty);
            }
        }
예제 #10
0
        public string Get(string propertyName)
        {
            switch (propertyName)
            {
            //ELEMENT
            case nameof(ClassId):
                return(ClassId.ToString());

            case nameof(AutomationId):
                return(AutomationId.ToString());

            case nameof(Id):
                return(Id.ToString());

            case nameof(StyleId):
                return(StyleId.ToString());

            //VISUAL ELEMENT
            case nameof(AnchorX):
                return(AnchorX.ToString());

            case nameof(AnchorY):
                return(AnchorY.ToString());

            case nameof(BackgroundColor):
                return(BackgroundColor.ToHex());

            case nameof(Width):
                return(this.Width.ToString());

            case nameof(Height):
                return(this.Height.ToString());

            case nameof(IsEnabled):
                return(IsEnabled.ToString());

            case nameof(WidthRequest):
                return(this.WidthRequest.ToString());

            case nameof(HeightRequest):
                return(this.HeightRequest.ToString());

            case nameof(IsFocused):
                return(IsFocused.ToString());

            case nameof(IsVisible):
                return(IsVisible.ToString());

            case nameof(InputTransparent):
                return(InputTransparent.ToString());

            case nameof(X):
                return(this.X.ToString());

            case nameof(Y):
                return(this.Y.ToString());

            case nameof(Opacity):
                return(this.Opacity.ToString());

            case nameof(TranslationX):
                return(this.TranslationX.ToString());

            case nameof(TranslationY):
                return(this.TranslationY.ToString());

            case nameof(Rotation):
                return(this.Rotation.ToString());

            case nameof(RotationX):
                return(this.RotationX.ToString());

            case nameof(RotationY):
                return(this.RotationY.ToString());

            case nameof(Scale):
                return(this.Scale.ToString());

            //VIEW
            case nameof(Margin):
                return(this.Margin.ToString());

            case nameof(VerticalOptions):
                return(this.VerticalOptions.ToString());

            case nameof(HorizontalOptions):
                return(this.HorizontalOptions.ToString());

            //IMAGE
            case nameof(Source):
                switch (Source)
                {
                case FileImageSource file:
                    return(file.File);

                case UriImageSource uri:
                    return(uri.Uri.ToString());

                default:
                    return(string.Empty);
                }

            case nameof(Aspect):
                return(this.Aspect.ToString());

            case nameof(IsOpaque):
                return(this.IsOpaque.ToString());

            default:
                return(string.Empty);
            }
        }
예제 #11
0
        public string Get(string propertyName)
        {
            switch (propertyName)
            {
                //ELEMENT
                case nameof(ClassId):
                    return ClassId.ToString();
                case nameof(AutomationId):
                    return AutomationId.ToString();
                case nameof(Id):
                    return Id.ToString();
                case nameof(StyleId):
                    return StyleId.ToString();
                //VISUAL ELEMENT
                case nameof(AnchorX):
                    return AnchorX.ToString();
                case nameof(AnchorY):
                    return AnchorY.ToString();
                case nameof(BackgroundColor):
                    return BackgroundColor.ToHex();
                case nameof(Width):
                    return this.Width.ToString();
                case nameof(Height):
                    return this.Height.ToString();
                case nameof(IsEnabled):
                    return IsEnabled.ToString();
                case nameof(WidthRequest):
                    return this.WidthRequest.ToString();
                case nameof(HeightRequest):
                    return this.HeightRequest.ToString();
                case nameof(IsFocused):
                    return IsFocused.ToString();
                case nameof(IsVisible):
                    return IsVisible.ToString();
                case nameof(InputTransparent):
                    return InputTransparent.ToString();
                case nameof(X):
                    return this.X.ToString();
                case nameof(Y):
                    return this.Y.ToString();
                case nameof(Opacity):
                    return this.Opacity.ToString();
                case nameof(TranslationX):
                    return this.TranslationX.ToString();
                case nameof(TranslationY):
                    return this.TranslationY.ToString();
                case nameof(Rotation):
                    return this.Rotation.ToString();
                case nameof(RotationX):
                    return this.RotationX.ToString();
                case nameof(RotationY):
                    return this.RotationY.ToString();
                case nameof(Scale):
                    return this.Scale.ToString();
                //VIEW
                case nameof(Margin):
                    return this.Margin.ToString();
                case nameof(VerticalOptions):
                    return this.VerticalOptions.ToString();
                case nameof(HorizontalOptions):
                    return this.HorizontalOptions.ToString();

                //PROGRESSBAR
                case nameof(Progress):
                    return this.Progress.ToString();

                default:
                    return string.Empty;

            }
        }
예제 #12
0
파일: Button.cs 프로젝트: pranart/FormTest
        public string Get(string propertyName)
        {
            switch (propertyName)
            {
            //ELEMENT
            case nameof(ClassId):
                return(ClassId.ToString());

            case nameof(AutomationId):
                return(AutomationId.ToString());

            case nameof(Id):
                return(Id.ToString());

            case nameof(StyleId):
                return(StyleId.ToString());

            //VISUAL ELEMENT
            case nameof(AnchorX):
                return(AnchorX.ToString());

            case nameof(AnchorY):
                return(AnchorY.ToString());

            case nameof(BackgroundColor):
                return(BackgroundColor.ToHex());

            case nameof(Width):
                return(this.Width.ToString());

            case nameof(Height):
                return(this.Height.ToString());

            case nameof(IsEnabled):
                return(IsEnabled.ToString());

            case nameof(WidthRequest):
                return(this.WidthRequest.ToString());

            case nameof(HeightRequest):
                return(this.HeightRequest.ToString());

            case nameof(IsFocused):
                return(IsFocused.ToString());

            case nameof(IsVisible):
                return(IsVisible.ToString());

            case nameof(InputTransparent):
                return(InputTransparent.ToString());

            case nameof(X):
                return(this.X.ToString());

            case nameof(Y):
                return(this.Y.ToString());

            case nameof(Opacity):
                return(this.Opacity.ToString());

            case nameof(TranslationX):
                return(this.TranslationX.ToString());

            case nameof(TranslationY):
                return(this.TranslationY.ToString());

            case nameof(Rotation):
                return(this.Rotation.ToString());

            case nameof(RotationX):
                return(this.RotationX.ToString());

            case nameof(RotationY):
                return(this.RotationY.ToString());

            case nameof(Scale):
                return(this.Scale.ToString());

            //VIEW
            case nameof(Margin):
                return(this.Margin.ToString());

            case nameof(VerticalOptions):
                return(this.VerticalOptions.ToString());

            case nameof(HorizontalOptions):
                return(this.HorizontalOptions.ToString());

            //BUTTON
            case nameof(BorderColor):
                return(BorderColor.ToHex());

    #pragma warning disable CS0618 // Type or member is obsolete
            case nameof(BorderRadius):
                return(BorderRadius.ToString());

    #pragma warning restore CS0618 // Type or member is obsolete
            case nameof(BorderWidth):
                return(BorderWidth.ToString());

            case nameof(CornerRadius):
                return(CornerRadius.ToString());

            case nameof(CommandParameter):
                return(CommandParameter.ToString());

            case nameof(FontAttributes):
                return(FontAttributes.ToString());

            case nameof(FontFamily):
                return(FontFamily);

            case nameof(FontSize):
                return(FontSize.ToString());

            case nameof(TextColor):
                return(TextColor.ToHex());

            case nameof(Text):
                return(Text);

            default:
                return(string.Empty);
            }
        }