public StackedArea()
 {
     InitializeComponent();
     (Chart.SecondaryAxis as NumericalAxis).Maximum = 170;
     (Chart.SecondaryAxis as NumericalAxis).Minimum = 0;
     viewModel = Chart.BindingContext as ViewModel;
     UpdateData();
 }
 public LiveUpdate()
 {
     InitializeComponent();
     viewModel = Chart.BindingContext as ViewModel;
     viewModel.LoadData1();
     (Chart.SecondaryAxis as NumericalAxis).Maximum = 1.5;
     (Chart.SecondaryAxis as NumericalAxis).Minimum = -1.5;
 }
 public AutoScrolling()
 {
     InitializeComponent();
     viewModel =  Chart.BindingContext as ViewModel;
     viewModel.LoadData();
     (Chart.PrimaryAxis as DateTimeAxis).AutoScrollingDelta = 5;
     (Chart.PrimaryAxis as DateTimeAxis).AutoScrollingDeltaType = DateTimeDeltaType.Seconds;
     (Chart.SecondaryAxis as NumericalAxis).Maximum = 100;
     (Chart.SecondaryAxis as NumericalAxis).Minimum = 0;
 }
 public StackedArea100()
 {
     InitializeComponent();
     viewModel = Chart.BindingContext as ViewModel;
     UpdateData();
 }
示例#5
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            viewModel = new ViewModel();
            assets    = this.Assets;
            LayoutInflater layoutInflater = LayoutInflater.From(this);

            view = layoutInflater.Inflate(Resource.Layout.EditorBannerMain, null);
            SetContentView(view);
            LinearLayout mainLayout = FindViewById <LinearLayout>
                                          (Resource.Id.editor_layout);

            visibilityLayout = FindViewById <LinearLayout>
                                   (Resource.Id.visibility_layout);
            visibilityLayout.Visibility = ViewStates.Gone;
            Button ok = FindViewById <Button>
                            (Resource.Id.button);
            Button cancel = FindViewById <Button>
                                (Resource.Id.button2);

            ok.Click     += Ok_Click;
            cancel.Click += Cancel_Click;
            editor        = new SfImageEditor(this);
            var bitmap = BitmapFactory.DecodeResource(Resources, BannerCreator.Image);

            editor.Bitmap = bitmap;
            mainLayout.AddView(editor);

            editor.ToolbarSettings.ToolbarItems.Clear();
            FooterToolbarItem banner = new FooterToolbarItem()
            {
                Text     = "Banner Types",
                SubItems = new List <ToolbarItem>()
                {
                    new ToolbarItem()
                    {
                        Text = "Facebook Post"
                    },
                    new ToolbarItem()
                    {
                        Text = "Facebook Cover"
                    },
                    new ToolbarItem()
                    {
                        Text = "Twitter Cover"
                    },
                    new ToolbarItem()
                    {
                        Text = "Twitter Post"
                    },
                    new ToolbarItem()
                    {
                        Text = "YouTubeChannel Cover"
                    },
                },
            };


            HeaderToolbarItem item2 = new HeaderToolbarItem();

            item2.Text = "Share";
            item2.Icon = BitmapFactory.DecodeResource(Resources, Resource.Drawable.share);
            HeaderToolbarItem crop = new HeaderToolbarItem();

            crop.Text = "Banner Types";
            editor.ToolbarSettings.ToolbarItems.Add(item2);
            editor.ToolbarSettings.ToolbarItems.Add(banner);
            editor.ToolbarSettings.ToolbarItemSelected += (sender, e) =>
            {
                if (e.ToolbarItem is HeaderToolbarItem)
                {
                    if ((e.ToolbarItem as HeaderToolbarItem).Text == "Share")
                    {
                        ShareImage();
                    }
                }
                if (e.ToolbarItem is ToolbarItem)
                {
                    var toolitem = e.ToolbarItem as ToolbarItem;
                    if (toolitem.Text != "Banner Types" && toolitem.Text != "Share")
                    {
                        visibilityLayout.Visibility = ViewStates.Visible;
                    }
                    if (toolitem.Text == "Facebook Post")
                    {
                        editor.ToggleCropping(1200, 900);
                    }
                    else if (toolitem.Text == "Facebook Cover")
                    {
                        editor.ToggleCropping(851, 315);
                    }
                    else if (toolitem.Text == "Twitter Cover")
                    {
                        editor.ToggleCropping(1500, 500);
                    }
                    else if (toolitem.Text == "Twitter Post")
                    {
                        editor.ToggleCropping(1024, 512);
                    }
                    else if (toolitem.Text == "YouTubeChannel Cover")
                    {
                        editor.ToggleCropping(2560, 1440);
                    }
                }
            };



            base.OnCreate(savedInstanceState);
        }
示例#6
0
            protected override void OnCreate(Bundle savedInstanceState)
            {
                viewModel = new ViewModel();
                LayoutInflater layoutInflater = LayoutInflater.From(this);

                view = layoutInflater.Inflate(Resource.Layout.EditorSerializationMain, null);
                SetContentView(view);
                LinearLayout mainLayout = FindViewById <LinearLayout>
                                              (Resource.Id.ContentView);

                listView      = FindViewById <ListView>(Resource.Id.right_drawer);
                mDrawerLayout = (DrawerLayout)FindViewById(Resource.Id.drawer_layout);
                tableItems.Add(new TableItem()
                {
                    ImageResourceId = viewModel.ModelList[0].Name, ImageName = "Coffee"
                });
                tableItems.Add(new TableItem()
                {
                    ImageResourceId = viewModel.ModelList[1].Name, ImageName = "Food"
                });
                tableItems.Add(new TableItem()
                {
                    ImageResourceId = viewModel.ModelList[2].Name, ImageName = "Syncfusion"
                });

                listView.Adapter = new HomeScreenAdapter(this, tableItems);

                listView.ItemClick += OnListItemClick;
                editor              = new SfImageEditor(this);
                editor.ImageSaving += Editor_ImageSaving;

                editor.Bitmap = SerializedTemplate.Image;
                assets        = this.Assets;
                LoadStream();
                DelayActionAsync(500, LoadStreamToEditor);

                //Add ToolBar items

                HeaderToolBarItem item1 = new HeaderToolBarItem();

                item1.Text = "Settings";
                item1.Icon = BitmapFactory.DecodeResource(Resources, Resource.Drawable.sett);
                HeaderToolBarItem item2 = new HeaderToolBarItem();

                item2.Text = "Share";
                item2.Icon = BitmapFactory.DecodeResource(Resources, Resource.Drawable.share);
                HeaderToolBarItem item3 = new HeaderToolBarItem();

                item3.Icon = BitmapFactory.DecodeResource(Resources, Resource.Drawable.info_24);

                editor.ToolbarSettings.ToolbarItems.Add(item1);
                editor.ToolbarSettings.ToolbarItems.Add(item2);
                editor.ToolbarSettings.ToolbarItems.Add(item3);

                editor.ToolbarSettings.ToolbarItemSelected += (sender, e) => {
                    if (e.Toolbar is HeaderToolBarItem)
                    {
                        var text = (e.Toolbar as HeaderToolBarItem).Text;
                        if (e.Toolbar is HeaderToolBarItem)
                        {
                            if ((e.Toolbar as HeaderToolBarItem).Text == "Share")
                            {
                                ShareImage();
                            }

                            if ((e.Toolbar as HeaderToolBarItem).Text == "Settings")
                            {
                                mDrawerLayout.OpenDrawer(listView);
                            }
                            if ((text != "Reset" && text != "undo" && text != "redo" && text != "Save" && text != "Settings" && text != "Share"))
                            {
                                string strin = "ImageEditor allows you to serialize and deserialize any custom edits(Shapes,Text,Path) over an image. In this sample we have deserialized some custom edits and loaded in to the editor.";
                                AlertDialog.Builder alert = new AlertDialog.Builder(this);
                                alert.SetTitle("About this sample");
                                alert.SetMessage(strin.ToString());
                                alert.SetNegativeButton("Ok", (senderAlert, args) => {
                                });
                                Dialog dialog = alert.Create();
                                dialog.Show();
                            }
                        }
                    }
                };
                mainLayout.AddView(editor);
                base.OnCreate(savedInstanceState);
            }