Quantcast
Channel: Silverlight Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 801

Commented Issue: LockablePivot crashes when tapping on the invisible headers [9612]

$
0
0
When the pivot control is locked, the additional headers fade out.
However, if you tap on the blank space left behind, the control throws an unhanded exception and the app crashes.
Comments: ** Comment from web user: yury_kalinau **

hi. I have found this bug too. Also I have spent a lot of time to find some workable fix. I hope that it can be useful for anybody else:

public class HotFixedPivot : LockablePivot
{
public static readonly DependencyProperty IsLockedProperty = DependencyProperty.Register("IsLocked", typeof(bool), typeof(HotFixedPivot), new PropertyMetadata(false, OnIsLockedChanged));

public new bool IsLocked {
get { return (bool)GetValue(IsLockedProperty); }
set { SetValue(IsLockedProperty, value); }
}

private static void OnIsLockedChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) {
var pivot = (HotFixedPivot)d;
var value = (bool)e.NewValue;
pivot.headers.IsEnabled = !value;
((LockablePivot)pivot).IsLocked = value;
}

private PivotHeadersControl headers;

public override void OnApplyTemplate() {
headers = GetTemplateChild("HeadersListElement") as PivotHeadersControl;
if (this.headers != null) {
headers.IsEnabled = !this.IsLocked;
}
base.OnApplyTemplate();
}
}


Viewing all articles
Browse latest Browse all 801

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>