This project is read-only.

ModernProgressRing IsActive Databinding

Dec 30, 2014 at 8:18 PM
Hi,

I am trying to databind IsActive property of the control to a dependecy property but it is not working.
<UserControl x:Class="MegoloadModern.Pages.Home"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:h="http://helixtoolkit.codeplex.com"
             xmlns:mui="http://firstfloorsoftware.com/ModernUI"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid Style="{StaticResource ContentRoot}">

        <mui:ModernProgressRing IsActive="{Binding IsLoading}" Width="80" Height="80" Panel.ZIndex="10" Style="{StaticResource WaveProgressRingStyle}" />

        <h:HelixViewport3D x:Name="mainViewport"  Grid.Column="0" Grid.RowSpan="1"  RotationSensitivity="0.3" InfiniteSpin="True" 
                           ZoomExtentsWhenLoaded="True" ZoomAroundMouseDownPoint="True">
            <h:HelixViewport3D.Children>
                <h:SunLight/>
                <ModelVisual3D Content="{Binding Model}"></ModelVisual3D>
            </h:HelixViewport3D.Children>
        </h:HelixViewport3D>

    </Grid>
</UserControl>
And my dependecy property is like this
        public bool IsLoading
        {
            get { return (bool)GetValue(IsLoadingProperty); }
            set { SetValue(IsLoadingProperty, value); }
        }

        public static readonly DependencyProperty IsLoadingProperty =
            DependencyProperty.Register("IsLoading", typeof(bool), typeof(HomeViewModel), new PropertyMetadata(false));


        public HomeViewModel()
        {
            IsLoading = true;
            .....
            .....
            IsLoading = false;
        }
thanks
Jan 1, 2015 at 7:59 PM
My mistake i wasn't executing code in a seperate thread therefore blocking ui thread causing the bindings to fail.
Marked as answer by mertkokusen on 1/1/2015 at 11:59 AM
Jun 9, 2015 at 2:16 PM
Hi mertkokusen,

I meet the same issue with you listed above, how do you solve this issue on your side? As your last comments said, we need to execute code in a seperate thread, I have tried to call it in a seperate thread, but it still doesn't work for me. Could you share your way or your source code to me here? Million thanks for your help.