Example #1
0
 protected override void OnDetachingFrom(SampleView bindable)
 {
     ListView1 = null;
     ListView2 = null;
     listViewOrientationViewModel = null;
     base.OnDetachingFrom(bindable);
 }
        protected override void OnAttachedTo(SampleView bindable)
        {
            ListView                   = bindable.FindByName <Syncfusion.ListView.XForms.SfListView>("listView");
            ListView.ItemHolding      += ListView_ItemHolding;
            ListView.SelectionChanged += ListView_SelectionChanged;

            if (Device.RuntimePlatform == Device.UWP)
            {
                ListView.FocusBorderThickness = new Thickness(1, 1, 1, 2);
            }

            SelectionViewModel      = new ListViewSelectionViewModel();
            ListView.BindingContext = SelectionViewModel;
            ListView.ItemsSource    = SelectionViewModel.MusicInfo;

            headerGrid = bindable.FindByName <Grid>("headerGrid");
            headerGrid.BindingContext = SelectionViewModel;

            selectionCancelImageParent = bindable.FindByName <Grid>("cancelImageParent");
            var selectionCancelImageTapped = new TapGestureRecognizer()
            {
                Command = new Command(selectionCancelImageTapped_Tapped)
            };

            selectionCancelImageParent.GestureRecognizers.Add(selectionCancelImageTapped);

            selectionEditImageParent = bindable.FindByName <Grid>("editImageParent");
            var selectionEditImageTapped = new TapGestureRecognizer()
            {
                Command = new Command(SelectionEditImageTapped_Tapped)
            };

            selectionEditImageParent.GestureRecognizers.Add(selectionEditImageTapped);
            base.OnAttachedTo(bindable);
        }
Example #3
0
        protected override void OnAttachedTo(ContentPage bindable)
        {
            ListView  = bindable.FindByName <Syncfusion.ListView.XForms.SfListView>("listView");
            viewModel = new ContactsViewModel();
            ListView.BindingContext = viewModel;
            ListView.ItemsSource    = viewModel.contactsinfo;
            ListView.DataSource.LiveDataUpdateMode = LiveDataUpdateMode.AllowDataShaping;


            ListView.DataSource.GroupDescriptors.Add(new GroupDescriptor()
            {
                PropertyName = "DateTime",

                KeySelector = (object obj1) =>
                {
                    var item = (obj1 as Contacts);
                    var date = string.Format("{0:MM/dd/yyyy}", item.DateTime);
                    return(date);
                },
                Comparer = new CustomGroupComparer()
            });

            ListView.DataSource.SortDescriptors.Add(new SortDescriptor()
            {
                PropertyName = "Time",
                Direction    = ListSortDirection.Descending
            });

            base.OnAttachedTo(bindable);
        }
Example #4
0
        protected override void OnAttachedTo(ContentPage bindable)
        {
            ListView = bindable.FindByName <Syncfusion.ListView.XForms.SfListView>("listView");
            sortingFilteringViewModel = new SortingFilteringViewModel();
            ListView.BindingContext   = sortingFilteringViewModel;
            ListView.ItemsSource      = sortingFilteringViewModel.Items;

            headerGrid = bindable.FindByName <Grid>("headerGrid");
            headerGrid.BindingContext = sortingFilteringViewModel;

            seachbar_Grid = bindable.FindByName <Grid>("seachbar_Grid");
            if (Device.RuntimePlatform == Device.UWP)
            {
                seachbar_Grid.Padding = new Thickness(5, 5, 0, 5);
            }

            //sortImageParent = bindable.FindByName<Grid>("sortImageParent");
            //var SortImageTapped = new TapGestureRecognizer() { Command = new Command(SortImageTapped_Tapped) };
            //sortImageParent.GestureRecognizers.Add(SortImageTapped);

            //if (Device.RuntimePlatform == Device.iOS)
            //    sortImageParent.BackgroundColor = Color.FromHex("#C9C8CE");
            //else if (Device.RuntimePlatform == Device.Android || Device.RuntimePlatform == Device.UWP)
            //    sortImageParent.BackgroundColor = Color.FromHex("#E4E4E4");

            searchBar = bindable.FindByName <SearchBar>("filterText");
            if (Device.RuntimePlatform == Device.macOS)
            {
                searchBar.PlaceholderColor = Color.Transparent;
            }

            searchBar.TextChanged += SearchBar_TextChanged;
            base.OnAttachedTo(bindable);
        }
Example #5
0
        protected override void OnAttachedTo(SampleView bindable)
        {
            viewModel = new PullToRefreshViewModel();
            bindable.BindingContext = viewModel;
            pullToRefresh           = bindable.FindByName <Syncfusion.SfPullToRefresh.XForms.SfPullToRefresh>("pullToRefresh");
            SubGrid1       = bindable.FindByName <Grid>("SubGrid1");
            SubGrid2       = bindable.FindByName <Grid>("SubGrid2");
            listView       = bindable.FindByName <Syncfusion.ListView.XForms.SfListView>("listView");
            transitionType = bindable.FindByName <PickerExt>("transitionType");
            label2         = bindable.FindByName <Label>("label2");
            label3         = bindable.FindByName <Label>("label3");
            imagedata      = bindable.FindByName <Image>("imagedata");

            SubGrid1.BindingContext        = viewModel.Data;
            pullToRefresh.PullingThreshold = 100;
            listView.ItemsSource           = viewModel.SelectedData;
            if (Device.RuntimePlatform == Device.iOS)
            {
                pullToRefresh.SizeChanged += Pull_SizeChanged;
            }
            pullToRefresh.Refreshing   += PullToRefresh_Refreshing;
            pullToRefresh.Refreshed    += PullToRefresh_Refreshed;
            listView.SelectionChanging += ListView_SelectionChanging;
            transitionType.Items.Add("Push");
            transitionType.Items.Add("SlideOnTop");
            transitionType.SelectedIndex         = 1;
            transitionType.SelectedIndexChanged += OnSelectionChanged;
            base.OnAttachedTo(bindable);
        }
Example #6
0
 protected override void OnDetachingFrom(SampleView bindable)
 {
     ListView               = null;
     sortImageParent        = null;
     searchBar              = null;
     searchBar.TextChanged -= SearchBar_TextChanged;
     base.OnDetachingFrom(bindable);
 }
Example #7
0
 protected override void OnDetachingFrom(SampleView bindable)
 {
     ListView.SelectionChanged -= ListView_SelectionChanged;
     ListView            = null;
     gridLayout          = null;
     deleteImageParent   = null;
     headerGrid          = null;
     gridLayoutViewModel = null;
     base.OnDetachingFrom(bindable);
 }
Example #8
0
        protected override void OnAttachedTo(SampleView bindable)
        {
            ListView1 = bindable.FindByName <Syncfusion.ListView.XForms.SfListView>("listView");
            ListView2 = bindable.FindByName <Syncfusion.ListView.XForms.SfListView>("listView1");
            listViewOrientationViewModel = new ListViewOrientationViewModel();
            ListView1.ItemsSource        = listViewOrientationViewModel.PizzaInfo;
            ListView2.ItemsSource        = listViewOrientationViewModel.PizzaInfo1;

            base.OnAttachedTo(bindable);
        }
 protected override void OnDetachingFrom(SampleView bindable)
 {
     ListView.ItemHolding      -= ListView_ItemHolding;
     ListView.SelectionChanged -= ListView_SelectionChanged;
     ListView = null;
     selectionCancelImageParent = null;
     selectionEditImageParent   = null;
     SelectionViewModel         = null;
     headerGrid = null;
     base.OnDetachingFrom(bindable);
 }
Example #10
0
        protected override void OnAttachedTo(ContentPage bindable)
        {
            ListView = bindable.FindByName <Syncfusion.ListView.XForms.SfListView>("listView");
            Button rightSwipeButton = bindable.FindByName <Button>("RightSwipe");
            Button leftSwipeButton  = bindable.FindByName <Button>("LeftSwipe");

            rightSwipeButton.Clicked += RightSwipeButton_Clicked;;
            leftSwipeButton.Clicked  += LeftSwipeButton_Clicked;;

            viewModel = new ContactsViewModel();
            ListView.BindingContext = viewModel;
            ListView.ItemsSource    = viewModel.contactsinfo;

            base.OnAttachedTo(bindable);
        }
Example #11
0
        protected override void OnAttachedTo(SampleView bindable)
        {
            ListView = bindable.FindByName <Syncfusion.ListView.XForms.SfListView>("listView");
            ListView.SelectionChanged += ListView_SelectionChanged;

            gridLayoutViewModel     = new ListViewGridLayoutViewModel();
            ListView.BindingContext = gridLayoutViewModel;
            ListView.ItemsSource    = gridLayoutViewModel.Gallerynfo;

            headerGrid = bindable.FindByName <Grid>("headerGrid");
            headerGrid.BindingContext = gridLayoutViewModel;

            deleteImageParent = bindable.FindByName <Grid>("deleteImageParent");
            var deleteImageTapped = new TapGestureRecognizer()
            {
                Command = new Command(DeleteImageTapped_tapped)
            };

            deleteImageParent.GestureRecognizers.Add(deleteImageTapped);

            gridLayout = new Syncfusion.ListView.XForms.GridLayout();

            if (Device.RuntimePlatform == Device.Android || Device.RuntimePlatform == Device.iOS)
            {
                gridLayout.SpanCount = Device.Idiom == TargetIdiom.Phone ? 2 : 4;
                ListView.ItemSize    = Device.Idiom == TargetIdiom.Phone || Device.Idiom == TargetIdiom.Tablet ? 150 : 170;
            }
            else if (Device.RuntimePlatform == Device.macOS)
            {
                gridLayout.SpanCount = 4;
                ListView.ItemSize    = 300;
            }
            else if (Device.RuntimePlatform == Device.UWP)
            {
                gridLayout.SpanCount = Device.Idiom == TargetIdiom.Desktop || Device.Idiom == TargetIdiom.Tablet ? 4 : 2;
                ListView.ItemSize    = Device.Idiom == TargetIdiom.Desktop || Device.Idiom == TargetIdiom.Tablet ? 300 : 140;
            }

            ListView.LayoutManager = gridLayout;
            ListView.DataSource.GroupDescriptors.Add(new GroupDescriptor()
            {
                PropertyName = "CreatedDate"
            });

            base.OnAttachedTo(bindable);
        }
Example #12
0
        protected override void OnAttachedTo(SampleView bindable)
        {
            ListView = bindable.FindByName <Syncfusion.ListView.XForms.SfListView>("listView");
            pulltoRefreshViewModel            = new ListViewPullToRefreshViewModel();
            pulltoRefreshViewModel.Navigation = bindable.Navigation;
            ListView.BindingContext           = pulltoRefreshViewModel;
            ListView.ItemsSource = pulltoRefreshViewModel.BlogsInfo;

            pullToRefresh             = bindable.FindByName <Syncfusion.SfPullToRefresh.XForms.SfPullToRefresh>("pullToRefresh");
            pullToRefresh.Refreshing += PullToRefresh_Refreshing;

            picker = bindable.FindByName <PickerExt>("transitionTypePicker");
            picker.Items.Add("SlideOnTop");
            picker.Items.Add("Push");
            picker.SelectedIndex         = 1;
            picker.SelectedIndexChanged += Picker_SelectedIndexChanged;
            base.OnAttachedTo(bindable);
        }
Example #13
0
 protected override void OnDetachingFrom(SampleView bindable)
 {
     pullToRefresh.SizeChanged           -= Pull_SizeChanged;
     pullToRefresh.Refreshing            -= PullToRefresh_Refreshing;
     pullToRefresh.Refreshed             -= PullToRefresh_Refreshed;
     listView.SelectionChanging          -= ListView_SelectionChanging;
     transitionType.SelectedIndexChanged -= OnSelectionChanged;
     pullToRefresh  = null;
     viewModel      = null;
     listView       = null;
     SubGrid1       = null;
     SubGrid2       = null;
     transitionType = null;
     label2         = null;
     label3         = null;
     imagedata      = null;
     base.OnDetachingFrom(bindable);
 }
        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);
        }
Example #15
0
 protected override void OnAttachedTo(SfListView bindable)
 {
     listview             = bindable.FindByName <Syncfusion.ListView.XForms.SfListView>("listView");
     listview.ItemsSource = AccordionViewModel.ContactsInfo;
     listview.ItemTapped += ListView_ItemTapped;
 }
Example #16
0
        protected override void OnAttachedTo(SampleView bindable)
        {
            if (initialPopup == null)
            {
                initialPopup = new DetailsViewInitialPopup().Content as Syncfusion.XForms.PopupLayout.SfPopupLayout;
                initialPopup.Show();
            }
            popupLayout          = bindable.FindByName <Syncfusion.XForms.PopupLayout.SfPopupLayout>("popUp");
            listview             = bindable.FindByName <Syncfusion.ListView.XForms.SfListView>("listView");
            listview.ItemsSource = viewModel.contactsinfo;
            listview.ItemTapped += ListView_ItemTapped;
            listview.Loaded     += Listview_Loaded;
            popupLayout.PopupView.AnimationMode = AnimationMode.None;
            popupLayout.PopupView.ShowHeader    = false;
            popupLayout.PopupView.ShowFooter    = false;
            popupLayout.PopupView.HeightRequest = 150;
            if (Device.RuntimePlatform == Device.iOS)
            {
                popupLayout.PopupView.PopupStyle.BorderColor = Color.White;
            }

            popupLayout.PopupView.ContentTemplate = new DataTemplate(() =>
            {
                Grid popupcontent              = new Grid();
                popupcontent.BackgroundColor   = Color.White;
                popupcontent.HorizontalOptions = LayoutOptions.FillAndExpand;
                popupcontent.VerticalOptions   = LayoutOptions.FillAndExpand;
                popupcontent.RowDefinitions.Add(new RowDefinition {
                    Height = 40
                });
                popupcontent.RowDefinitions.Add(new RowDefinition {
                    Height = 40
                });
                popupcontent.RowDefinitions.Add(new RowDefinition {
                    Height = 40
                });
                popupcontent.ColumnDefinitions.Add(new ColumnDefinition {
                    Width = 50
                });
                popupcontent.ColumnDefinitions.Add(new ColumnDefinition {
                    Width = 500
                });

                sendMessageText                   = new Label();
                sendMessageText.Text              = "Send a Message";
                sendMessageText.TextColor         = Color.FromHex("#000000");
                sendMessageText.FontSize          = 16;
                sendMessageText.HorizontalOptions = LayoutOptions.Start;
                sendMessageText.VerticalOptions   = LayoutOptions.Center;
                sendMessageText.Opacity           = 87;


                sendMessageImage         = new Image();
                sendMessageImage.Opacity = 0.5f;
#if COMMONSB
                sendMessageImage.Source = ImageSource.FromResource("SampleBrowser.Images.SendMessage.png", typeof(DetailsViewBehaviors).GetTypeInfo().Assembly);
#else
                sendMessageImage.Source = ImageSource.FromResource("SampleBrowser.SfPopupLayout.Images.SendMessage.png", typeof(DetailsViewBehaviors).GetTypeInfo().Assembly);
#endif
                sendMessageImage.WidthRequest      = 20;
                sendMessageImage.HeightRequest     = 20;
                sendMessageImage.HorizontalOptions = LayoutOptions.CenterAndExpand;
                sendMessageImage.VerticalOptions   = LayoutOptions.CenterAndExpand;

                blockSpanText                   = new Label();
                blockSpanText.Text              = "Block / Report Spam";
                blockSpanText.TextColor         = Color.FromHex("#000000");
                blockSpanText.FontSize          = 16;
                blockSpanText.HorizontalOptions = LayoutOptions.Start;
                blockSpanText.VerticalOptions   = LayoutOptions.Center;
                blockSpanText.Opacity           = 87;


                blockSpanImage         = new Image();
                blockSpanImage.Opacity = 0.5f;
#if COMMONSB
                blockSpanImage.Source = ImageSource.FromResource("SampleBrowser.Images.BlockSpan.png", typeof(DetailsViewBehaviors).GetTypeInfo().Assembly);
#else
                blockSpanImage.Source = ImageSource.FromResource("SampleBrowser.SfPopupLayout.Images.BlockSpan.png", typeof(DetailsViewBehaviors).GetTypeInfo().Assembly);
#endif
                blockSpanImage.HeightRequest     = 20;
                blockSpanImage.WidthRequest      = 20;
                blockSpanImage.HorizontalOptions = LayoutOptions.CenterAndExpand;
                blockSpanImage.VerticalOptions   = LayoutOptions.CenterAndExpand;

                callDetailText                   = new Label();
                callDetailText.Text              = "Send a Message";
                callDetailText.TextColor         = Color.FromHex("#000000");
                callDetailText.FontSize          = 16;
                callDetailText.HorizontalOptions = LayoutOptions.Start;
                callDetailText.VerticalOptions   = LayoutOptions.Center;
                callDetailText.Opacity           = 87;


                callDetailImage         = new Image();
                callDetailImage.Opacity = 0.5f;
#if COMMONSB
                callDetailImage.Source = ImageSource.FromResource("SampleBrowser.Images.CallDetails.png", typeof(DetailsViewBehaviors).GetTypeInfo().Assembly);
#else
                callDetailImage.Source = ImageSource.FromResource("SampleBrowser.SfPopupLayout.Images.CallDetails.png", typeof(DetailsViewBehaviors).GetTypeInfo().Assembly);
#endif
                callDetailImage.HeightRequest     = 20;
                callDetailImage.WidthRequest      = 20;
                callDetailImage.HorizontalOptions = LayoutOptions.CenterAndExpand;
                callDetailImage.VerticalOptions   = LayoutOptions.CenterAndExpand;

                if (Device.RuntimePlatform == Device.iOS || Device.RuntimePlatform == Device.UWP)
                {
                    popupcontent.Padding = 10;

                    sendMessageText.Margin        = new Thickness(0, 10, 0, 0);
                    sendMessageText.WidthRequest  = 500;
                    sendMessageText.HeightRequest = 40;

                    sendMessageImage.WidthRequest  = 20;
                    sendMessageImage.HeightRequest = 20;

                    blockSpanText.Margin        = new Thickness(0, 10, 0, 0);
                    blockSpanText.WidthRequest  = 500;
                    blockSpanText.HeightRequest = 40;

                    blockSpanImage.WidthRequest  = 20;
                    blockSpanImage.HeightRequest = 20;

                    callDetailText.Margin        = new Thickness(0, 10, 0, 0);
                    callDetailText.WidthRequest  = 500;
                    callDetailText.HeightRequest = 40;

                    callDetailImage.WidthRequest  = 20;
                    callDetailImage.HeightRequest = 20;
                }

                popupcontent.Children.Add(sendMessageImage, 0, 0);
                popupcontent.Children.Add(sendMessageText, 1, 0);
                popupcontent.Children.Add(blockSpanImage, 0, 1);
                popupcontent.Children.Add(blockSpanText, 1, 1);
                popupcontent.Children.Add(callDetailImage, 0, 2);
                popupcontent.Children.Add(callDetailText, 1, 2);
                return(popupcontent);
            });
        }