tbaggett / xfgloss

New styling properties for standard Xamarin.Forms controls
Other
160 stars 25 forks source link

No property, bindable property, or event found for 'StepColor' #20

Open deanilvincent opened 7 years ago

deanilvincent commented 7 years ago

Hi,

By the way, I like using your xfgloss plugin :)

I'm just having issues and I'm trying to bind the value of the color via view model but I guess the plugin doesn't support yet right? :)

tbaggett commented 7 years ago

Hi @deanilvincent,

Just to confirm, you're referring to a gradient, like this Xaml markup from https://github.com/tbaggett/xfgloss/blob/master/XFGlossSample/Examples/Views/Xaml/BackgroundGradientPage.xaml, right?

<TextCell Text="All Three" TextColor="White">
    <!-- You can also create gradients at any angle with as many steps as you want. -->
    <xfg:CellGloss.BackgroundGradient>
        <xfg:Gradient x:Name="rotatingGradient" Rotation="135">
            <xfg:GradientStep StepColor="Red" StepPercentage="0" />
            <xfg:GradientStep StepColor="Maroon" StepPercentage=".25" />
            <xfg:GradientStep StepColor="Lime" StepPercentage=".4" />
            <xfg:GradientStep StepColor="Green" StepPercentage=".6" />
            <xfg:GradientStep StepColor="Blue" StepPercentage=".75" />
            <xfg:GradientStep StepColor="Navy" StepPercentage="1" />
        </xfg:Gradient>
    </xfg:CellGloss.BackgroundGradient>
</TextCell>

If so, you should be able to specify a binding for the StepColor property, like this for example, where GradientColor1 is a Xamarin.Forms.Color property on your view model:

<xfg:GradientStep StepColor="{Binding GradientColor1}" StepPercentage="0" />

I reviewed the code for StepColor and it is set up for detecting property changed notifications, so the above should work.

If this is how you have it set up and it isn't working, can you provide a copy of your view model and view sources files? Its okay to remove unrelated stuff from them if needed.

deanilvincent commented 7 years ago

Hello @tbaggett

Thank you for your quick response :)

Yeah, I'm following those syntax for xaml.

I can provide my codes here:

Here's my Xaml

// The connection in my viewmodel is working since some of my ui controls inside this xaml are bindable from that viewmodel

<xfg:GradientStep StepColor="{Binding StepColorTop}" StepPercertage="0"/> 
<xfg:GradientStep StepColor="{Binding StepColorBottom}" StepPercertage=".9"/>

Here's my ViewModel

pubic SettingsViewModel(){
    if(// if allow gradient is true){
        _stepColorTop = "#f9ad96";
        _stepColorBottom = "#f66666";
    }else{
        _stepColorTop = "#ffffff";
        _stepColorBottom = "#ffffff";
    }
}

private string _stepColorTop;
public string StepColorTop{
    get { return _stepColorTop; }
    set { _stepColorTop = value; OnPropertyChanged(); }
}

private string _stepColorBottom;
public string StepColorBottom{
    get { return _stepColorBottom; }
    set { _stepColorBottom = value; OnPropertyChanged(); }
}

I can't really able to run or build it since the error is pointing in my xaml that says,

Position 15:31. No property, bindable property, or event found for 'StepColor'

Thank you in advance :)

tbaggett commented 7 years ago

Okay great, thanks for the confirmation. Unfortunately I won't have a chance to look at this for a few weeks. I will let you know when a new version is released to address this.

deanilvincent commented 7 years ago

Oh I understand. It is fine. :) Just let me know when new release has been added. :D

deanilvincent commented 7 years ago

Thanks man. I wish you a great and safe day :)

deanilvincent commented 7 years ago

Hello @tbaggett How is it going? :)

tbaggett commented 7 years ago

Hi @deanilvincent, I'm still trying to wrap up my current contract project. I am planning to work on XFGloss as soon as the current project is done.

deanilvincent commented 7 years ago

Hello @tbaggett Oh cool. Sure, take your time. Thank you for your quick response :)

tbaggett commented 6 years ago

Hi @deanilvincent, fyi I finally got an update out that adds Netstandard 2.0 and Xamarin.Forms 2.5 support. I will start looking at enhancements now.