Open.Core.UI.Controls.CoreComboBox.InitializeBindings C# (CSharp) Method

InitializeBindings() private method

private InitializeBindings ( ) : void
return void
        private void InitializeBindings()
        {
            // Setup the collection binding.
            ItemsSource = ViewModel.Items;

            // Bind to the 'SelectedItem' property.
            var selectedItemBinding = new Binding(LinqExtensions.GetPropertyName<ComboBoxViewModel>(m => m.SelectedItem))
                              {
                                  Mode = BindingMode.TwoWay
                              };
            SetBinding(SelectedItemProperty, selectedItemBinding);

            // Bind the tooltip.
            var tooltipBinding = new Binding(LinqExtensions.GetPropertyName<ComboBoxViewModel>(m => m.ToolTip));
            SetBinding(ToolTipService.ToolTipProperty, tooltipBinding);
        }
        #endregion