コード例 #1
0
ファイル: ListViewRenderer.cs プロジェクト: sung-su/maui
        void OnControlSelectionChanged(object sender, WSelectionChangedEventArgs e)
        {
            bool areEqual = false;

            if (Element.SelectedItem != null && Element.SelectedItem.GetType().IsValueType)
            {
                areEqual = Element.SelectedItem.Equals(List.SelectedItem);
            }
            else
            {
                areEqual = Element.SelectedItem == List.SelectedItem;
            }

            if (!areEqual)
            {
                if (_itemWasClicked)
                {
                    List.SelectedItem = Element.SelectedItem;
                }
                else
                {
                    ((IElementController)Element).SetValueFromRenderer(ListView.SelectedItemProperty, List.SelectedItem);
                }
            }

            _itemWasClicked = false;
        }
コード例 #2
0
 void OnControlSelectionChanged(object sender, WSelectionChangedEventArgs e)
 {
     if (Element != null)
     {
         Element.SelectedIndex = Control.SelectedIndex;
     }
 }
コード例 #3
0
 void OnControlSelectionChanged(object?sender, WSelectionChangedEventArgs e)
 {
     if (VirtualView != null && PlatformView != null)
     {
         VirtualView.SelectedIndex = PlatformView.SelectedIndex;
     }
 }
コード例 #4
0
        private void ItemFilter_SelectionChanged(object sender, Microsoft.UI.Xaml.Controls.SelectionChangedEventArgs e)
        {
            var updatedItems = (from item in _allItems
                                where string.IsNullOrWhiteSpace(ItemFilter.SelectedValue.ToString()) ||
                                ItemFilter.SelectedValue.ToString() == "All" ||
                                ItemFilter.SelectedValue.ToString() == item.MediaType.ToString()
                                select item).ToList();

            ItemList.ItemsSource = updatedItems;
        }
コード例 #5
0
 private void OnViewTypeComboboxSelectionChanged(object sender, Microsoft.UI.Xaml.Controls.SelectionChangedEventArgs e)
 {
     if (viewtypecombobox.SelectedValue != null)
     {
         if (viewtypecombobox.SelectedValue.ToString() == "TimelineMonth")
         {
             this.scheduler.TimelineViewSettings.TimeIntervalSize = 150;
         }
         else
         {
             this.scheduler.TimelineViewSettings.TimeIntervalSize = 50;
         }
     }
 }
コード例 #6
0
		void OnSelectionChanged(object sender, WSelectionChangedEventArgs e)
		{
			if (Element == null)
				return;

			Page page = e.AddedItems.Count > 0 ? (Page)e.AddedItems[0] : null;
			Page currentPage = Element.CurrentPage;
			if (currentPage == page)
				return;
			currentPage?.SendDisappearing();
			Element.CurrentPage = page;

			UpdateSelectedTabColors();

			page?.SendAppearing();
		}
コード例 #7
0
        void OnSelectionChanged(object sender, WSelectionChangedEventArgs e)
        {
            if (_fromUpdate)
            {
                return;
            }

            var         page        = (ContentPage)SelectedItem;
            ContentPage currentPage = Element.CurrentPage;

            if (currentPage == page)
            {
                return;
            }
            currentPage?.SendDisappearing();
            Element.CurrentPage = page;
            page?.SendAppearing();
        }
コード例 #8
0
        void OnSelectionChanged(object sender, WSelectionChangedEventArgs e)
        {
            if (!_ignoreSelectionEvent)
            {
                foreach (object item in e.AddedItems)
                {
                    if (item is Cell cell)
                    {
                        if (cell.IsEnabled)
                        {
                            Element.Model.RowSelected(cell);
                        }
                        break;
                    }
                }
            }

            if (Control == null)
            {
                return;
            }

            Control.SelectedItem = null;
        }
コード例 #9
0
ファイル: FormsComboBox.cs プロジェクト: sung-su/maui
 void FormsComboBoxSelectionChanged(object sender, Microsoft.UI.Xaml.Controls.SelectionChangedEventArgs e)
 {
     MinWidth = 0;
 }