aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.SharedUI/Converters/LastItemInContainerToBooleanConverter.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/Tango.SharedUI/Converters/LastItemInContainerToBooleanConverter.cs')
-rw-r--r--Software/Visual_Studio/Tango.SharedUI/Converters/LastItemInContainerToBooleanConverter.cs6
1 files changed, 2 insertions, 4 deletions
diff --git a/Software/Visual_Studio/Tango.SharedUI/Converters/LastItemInContainerToBooleanConverter.cs b/Software/Visual_Studio/Tango.SharedUI/Converters/LastItemInContainerToBooleanConverter.cs
index ec45fb8b1..b1c0ed904 100644
--- a/Software/Visual_Studio/Tango.SharedUI/Converters/LastItemInContainerToBooleanConverter.cs
+++ b/Software/Visual_Studio/Tango.SharedUI/Converters/LastItemInContainerToBooleanConverter.cs
@@ -14,11 +14,9 @@ namespace Tango.SharedUI.Converters
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
- DependencyObject item = (DependencyObject)value;
+ DependencyObject item = value as DependencyObject;
ItemsControl ic = ItemsControl.ItemsControlFromItemContainer(item);
-
- return ic.ItemContainerGenerator.IndexFromContainer(item)
- == ic.Items.Count - 1;
+ return ic.ItemContainerGenerator.IndexFromContainer(item) == ic.Items.Count - 1;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)