Exemple #1
0
        private void StatusBar_LayoutUpdated(object sender, EventArgs e)
        {
            statusBarView.LayoutUpdated -= StatusBar_LayoutUpdated;

            var textBlock = statusBarView.FindVisualChildren <TextBlock>()
                            .Where(x => x.GetBindingExpression(TextBlock.TextProperty) == null ? false : x.GetBindingExpression(TextBlock.TextProperty).ParentBinding.Path.Path == "TotalViewRange")
                            .First();

            var losBinding = new Binding();

            losBinding.Path      = new PropertyPath("TotalViewRange");
            losBinding.Converter = new FleetToViewRangeConverter();
            textBlock.SetBinding(TextBlock.TextProperty, losBinding);

            statusBarView = null;
        }