Skip to content
This repository has been archived by the owner on Feb 4, 2022. It is now read-only.

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

Open
deanilvincent opened this issue Jul 31, 2017 · 9 comments
Open

Comments

@deanilvincent
Copy link

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
Copy link
Owner

tbaggett commented Aug 2, 2017

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
Copy link
Author

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
Copy link
Owner

tbaggett commented Aug 2, 2017

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
Copy link
Author

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

@deanilvincent
Copy link
Author

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

@deanilvincent
Copy link
Author

Hello @tbaggett How is it going? :)

@tbaggett
Copy link
Owner

tbaggett commented Sep 5, 2017

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
Copy link
Author

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

@tbaggett
Copy link
Owner

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants