void DataBorder_Loaded(object sender, RoutedEventArgs e) { this.Loaded -= DataBorder_Loaded; RecalculateVisibility(null, DataContext); }