Esempio n. 1
0
 public Serialization()
 {
     InitializeComponent();
     model = new SerializationViewModel();
     listView.BindingContext = model;
     listView.ItemsSource    = model.ModelList;
     #if COMMONSB
     deleteImage.Source = ImageSource.FromResource("SampleBrowser.Icons.Delete1.png", assembly);
     #else
     deleteImage.Source = ImageSource.FromResource("SampleBrowser.SfImageEditor.Icons.Delete1.png", assembly);
     #endif
 }
 public Serialization()
 {
     InitializeComponent();
     model = new SerializationViewModel();
     listView.BindingContext = model;
     listView.ItemsSource    = model.ModelList;
     deleteImage.Source      = new FontImageSource()
     {
         Glyph      = "\ue735",
         FontFamily = Device.RuntimePlatform == Device.iOS ? "Sync FontIcons" : Device.RuntimePlatform == Device.Android ? "Sync FontIcons.ttf#" : "Sync FontIcons.ttf#Sync FontIcons",
         Color      = Color.FromHex("#616161")
     };
 }
        public SerializationContentPage(SerializationModel selectedItem, Syncfusion.ListView.XForms.SfListView listView, SerializationViewModel model)
        {
            InitializeComponent();
            mainModel = model;
            SelectedItem = selectedItem;
            imageEditor.SetToolbarItemVisibility("save", false);
            CustomHeader item1 = new CustomHeader();
            item1.Text = "Save Edits";
            item1.HeaderName = "Save";
            imageEditor.ImageSaving += ImageEditor_ImageSaving;
            imageEditor.ToolbarSettings.ToolbarItems.Add(item1);

            imageEditor.ToolbarSettings.ToolbarItemSelected += (sender, e) =>
            {

                if (e.ToolbarItem is CustomHeader)
                {

                    var text = (e.ToolbarItem as CustomHeader).HeaderName;
                    if (text == "Save")
                    {
                        if (SelectedItem.ImageName == "CreateNew")
                        {
                            popup.IsVisible = true;
                            grid.IsVisible = true;
                        }
                        else
                            imageEditor.Save();

                    }

                }
            };
            if (Device.RuntimePlatform == Device.UWP && SelectedItem.ImageName == "CreateNew")
            {
#if COMMONSB
                imageEditor.Source = ImageSource.FromResource("SampleBrowser.Icons.Plain.png", assembly);
#else
                imageEditor.Source = ImageSource.FromResource("SampleBrowser.SfImageEditor.Icons.Plain.png", assembly);
#endif

            }
            DelayActionAsync(1500, Action);
        }