or
this
.GridView.Columns[4].GetBindingExpression(GridViewComboBoxColumn.ItemsSourceProperty).DataItem
this
.GridView.Columns[4].DataContext
<
UserControl.InputBindings
>
<
KeyBinding
Key
=
"Enter"
Command
=
"{Binding Path=AddSelectedProductTypeCommand}"
/>
</
UserControl.InputBindings
>
public
static
class
MultiSelect
{
static
MultiSelect()
{
Selector.ItemsSourceProperty.OverrideMetadata(
typeof
(Selector),
new
FrameworkPropertyMetadata(ItemsSourceChanged));
}
public
static
bool
GetIsEnabled(Selector target)
{
return
(
bool
)target.GetValue(IsEnabledProperty);
}
public
static
void
SetIsEnabled(Selector target,
bool
value)
{
target.SetValue(IsEnabledProperty, value);
}
public
static
readonly
DependencyProperty IsEnabledProperty =
DependencyProperty.RegisterAttached(
"IsEnabled"
,
typeof
(
bool
),
typeof
(MultiSelect),
new
UIPropertyMetadata(IsEnabledChanged));
static
void
IsEnabledChanged(
object
sender, DependencyPropertyChangedEventArgs e)
{
Selector selector = sender
as
Selector;
IMultiSelectCollectionView collectionView = selector.ItemsSource
as
IMultiSelectCollectionView;
if
(selector !=
null
&& collectionView !=
null
)
{
if
((
bool
)e.NewValue)
{
collectionView.AddControl(selector);
}
else
{
collectionView.RemoveControl(selector);
}
}
}
static
void
ItemsSourceChanged(
object
sender, DependencyPropertyChangedEventArgs e)
{
Selector selector = sender
as
Selector;
if
(GetIsEnabled(selector))
{
IMultiSelectCollectionView oldCollectionView = e.OldValue
as
IMultiSelectCollectionView;
IMultiSelectCollectionView newCollectionView = e.NewValue
as
IMultiSelectCollectionView;
if
(oldCollectionView !=
null
)
{
oldCollectionView.RemoveControl(selector);
}
if
(newCollectionView !=
null
)
{
newCollectionView.AddControl(selector);
}
}
}
}
StepAction="MoveRange" and range is moving with the mouse click.
But the issue is that when I a dragging mouse then range is changing. How do I disable the Mouse drag.
HorizontalAlignment="Right"
IsSnapToTickEnabled="True"
Margin="0,10,12,52"
Minimum="1"
Name="monthSlider"
Maximum="12"
SmallChange="0"
StepAction="MoveRange"
TickFrequency="1"
LargeChange="3"
SelectionEnd="3"
SelectionStart="1"
IsSelectionRangeEnabled="True"
SelectionRangeChanged="monthSlider_SelectionRangeChanged"