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();
}
}