CommonControls.CommonLightBox.BindUIElement C# (CSharp) Method

BindUIElement() public method

public BindUIElement ( UIElement elem ) : void
elem UIElement
return void
        public void BindUIElement(UIElement elem)
        {
            TargetPanel.Children.Clear();
            TargetPanel.Children.Add(elem);
        }

Usage Example

        public void ExecuteOnAdd(ObservableCollection<AppearListViewItemModel> dataList)
        {
            CommonLightBox dialog = new CommonLightBox();

            TagsSelectorView selectorView = new TagsSelectorView();
            var tagSelectorViewModel = new TagSelectorViewModel();
            SetSelectingTags(tagSelectorViewModel.SelectingTags);
            selectorView.SetModel(tagSelectorViewModel);

            dialog.Owner = Application.Current.MainWindow;
            dialog.BindUIElement(selectorView);
            dialog.LightBoxKind = CommonLightBox.CommonLightBoxKind.SaveCancel;

            dialog.IsStretchable = false;

            selectorView.Height = Application.Current.MainWindow.ActualHeight - 80;
            selectorView.Width = Application.Current.MainWindow.ActualWidth - 80;

            selectorView.DataContext = tagSelectorViewModel;

            if (ShowDialogManager.ShowDialog(dialog) == true)
            {
                tagSelectorViewModel.UpdateModelsComposite();
                _stickable.SetTagIds(GetSelectingTagIds(tagSelectorViewModel.SelectingTags));

                dataList.Clear();
                var list = TagToAppearListViewModelConverter.ToAppearListViewItemModel(_stickable.GetTagIds(), _tagManager);
                foreach (var newItemModel in list)
                {
                    dataList.Add(newItemModel);
                }
            }
        }
All Usage Examples Of CommonControls.CommonLightBox::BindUIElement