Ribbon.Visibility detaches with MetroLight theme

Ribbon for WPF Forum

Posted 11 years ago by Bjørnar Sundsbø - Norway
Version: 13.1.0582
Platform: .NET 4.5
Environment: Windows 8 (64-bit)
Avatar

In the latest build of the ribbon controls, the Ribbon.Visibility property detatches bindings the second time the bound property is set. This seems to happen in MetroLight/MetroWhite theme. Changing to OfficeBlack, it works just fine.

Initial startup:

System.Windows.Data Warning: 56 : Created BindingExpression (hash=1669506) for Binding (hash=59837824)
System.Windows.Data Warning: 58 : Path: 'LoginViewModel.IsLoginVisible'
System.Windows.Data Warning: 61 : BindingExpression (hash=1669506): Default update trigger resolved to PropertyChanged
System.Windows.Data Warning: 62 : BindingExpression (hash=1669506): Attach to ActiproSoftware.Windows.Controls.Ribbon.Ribbon.Visibility (hash=9111029)
System.Windows.Data Warning: 67 : BindingExpression (hash=1669506): Resolving source
System.Windows.Data Warning: 70 : BindingExpression (hash=1669506): Found data context element: Ribbon (hash=9111029) (OK)
System.Windows.Data Warning: 71 : BindingExpression (hash=1669506): DataContext is null
System.Windows.Data Warning: 65 : BindingExpression (hash=1669506): Resolve source deferred
System.Windows.Data Warning: 67 : BindingExpression (hash=1669506): Resolving source
System.Windows.Data Warning: 70 : BindingExpression (hash=1669506): Found data context element: Ribbon (hash=9111029) (OK)
System.Windows.Data Warning: 78 : BindingExpression (hash=1669506): Activate with root item MainViewModel (hash=36689595)
System.Windows.Data Warning: 108 : BindingExpression (hash=1669506): At level 0 - for MainViewModel.LoginViewModel found accessor RuntimePropertyInfo(LoginViewModel)
System.Windows.Data Warning: 104 : BindingExpression (hash=1669506): Replace item at level 0 with MainViewModel (hash=36689595), using accessor RuntimePropertyInfo(LoginViewModel)
System.Windows.Data Warning: 101 : BindingExpression (hash=1669506): GetValue at level 0 from MainViewModel (hash=36689595) using RuntimePropertyInfo(LoginViewModel): LoginViewModel (hash=33449458)
System.Windows.Data Warning: 108 : BindingExpression (hash=1669506): At level 1 - for LoginViewModel.IsLoginVisible found accessor RuntimePropertyInfo(IsLoginVisible)
System.Windows.Data Warning: 104 : BindingExpression (hash=1669506): Replace item at level 1 with LoginViewModel (hash=33449458), using accessor RuntimePropertyInfo(IsLoginVisible)
System.Windows.Data Warning: 101 : BindingExpression (hash=1669506): GetValue at level 1 from LoginViewModel (hash=33449458) using RuntimePropertyInfo(IsLoginVisible): 'True'
System.Windows.Data Warning: 80 : BindingExpression (hash=1669506): TransferValue - got raw value 'True'
System.Windows.Data Warning: 82 : BindingExpression (hash=1669506): TransferValue - user's converter produced 'Collapsed'
System.Windows.Data Warning: 89 : BindingExpression (hash=1669506): TransferValue - using final value 'Collapsed'

Setting the property the first time:

System.Windows.Data Warning: 95 : BindingExpression (hash=1669506): Got PropertyChanged event from LoginViewModel (hash=33449458)
System.Windows.Data Warning: 101 : BindingExpression (hash=1669506): GetValue at level 1 from LoginViewModel (hash=33449458) using RuntimePropertyInfo(IsLoginVisible): 'False'
System.Windows.Data Warning: 80 : BindingExpression (hash=1669506): TransferValue - got raw value 'False'
System.Windows.Data Warning: 82 : BindingExpression (hash=1669506): TransferValue - user's converter produced 'Visible'
System.Windows.Data Warning: 89 : BindingExpression (hash=1669506): TransferValue - using final value 'Visible'

Setting property the second time:

System.Windows.Data Warning: 79 : BindingExpression (hash=14890402): Deactivate
System.Windows.Data Warning: 103 : BindingExpression (hash=14890402): Replace item at level 0 with {NullDataItem}
System.Windows.Data Warning: 103 : BindingExpression (hash=14890402): Replace item at level 1 with {NullDataItem}
System.Windows.Data Warning: 63 : BindingExpression (hash=14890402): Detach


Bjørnar Sundsbø

Comments (2)

Answer - Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Bjørnar,

If the IsRibbonVisibleWithBackstage property is set to false (which I believe it is in Metro themes), RibbonWindow puts a binding on the Ribbon's Visibility property to hide it when Backstage opens.

If you need to control visibility yourself, put your binding on a containing element of Ribbon instead so that your binding won't get wiped out.


Actipro Software Support

Posted 11 years ago by Bjørnar Sundsbø - Norway
Avatar

Thanks!


Bjørnar Sundsbø

The latest build of this product (v24.1.2) was released 1 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.