Comments (49)
Sharpnado.Shadows 1.1.0 has been released \o/
from sharpnado.shadows.
Put the unzipped package in a folder and add this folder as a local nuget storage.
cool, from the initial test looks great :) waiting for the official release.
appreciate the efforts!
from sharpnado.shadows.
@roubachof Hi, when will you publish the new package?
from sharpnado.shadows.
Just wanted to mention that I am also interested in the next version.
from sharpnado.shadows.
ohoh, I maybe eer, maybe forgot to pass the Shadows
BindingContext
to its Shades
.
whoopsie.
Could you try the following and see if it works ?
<sh:Shade BlurRadius="10"
BindingContext="{Binding YourModel}"
Opacity="0.5"
Offset="10,10"
Color="{Binding Color}" />
Will fix this silly mistake quickly
from sharpnado.shadows.
or you could do:
<sh:Shade BlurRadius="10"
Opacity="0.5"
Offset="10,10"
Color="{Binding Source={RelativeSource AncestorType={x:Type local:YourModel}}, Path=Color}" />
It's just a workaround till waiting for the fix
from sharpnado.shadows.
@roubachof thanks, this - local:YourModel is my ViewModel?
from sharpnado.shadows.
in the example with RelativeSource, it is your ViewModel type yes.
from sharpnado.shadows.
so it doesn't work, this is a selected item in a list.
from sharpnado.shadows.
what is the name of your item ViewModel, and show me your xaml
from sharpnado.shadows.
Sure :)
<?xml version="1.0" encoding="UTF-8" ?>
<views:ViewContentBase
x:Class="PetActivityMobile.Core.Views.DeviceSetup.DeviceLocate.DeviceLocateSetupLedColorView"
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:border="clr-namespace:Syncfusion.XForms.Border;assembly=Syncfusion.Core.XForms"
xmlns:customControls="clr-namespace:PetActivityMobile.Core.CustomControls;assembly=PetActivityMobile.Core"
xmlns:gradient="clr-namespace:Syncfusion.XForms.Graphics;assembly=Syncfusion.Core.XForms"
xmlns:local="clr-namespace:PetActivityMobile.Core.ViewModels.DeviceSetup.DeviceLocate;assembly=PetActivityMobile.Core"
xmlns:scrControls="clr-namespace:PetActivityMobile.Core.CustomControls.ScrControls;assembly=PetActivityMobile.Core"
xmlns:services="clr-namespace:Infra.Core.Services;assembly=Infra.Core"
xmlns:sfList="clr-namespace:Syncfusion.ListView.XForms;assembly=Syncfusion.SfListView.XForms"
xmlns:shades="clr-namespace:Sharpnado.Shades;assembly=Sharpnado.Shadows"
xmlns:views="clr-namespace:PetActivityMobile.Core.Views.Base;assembly=PetActivityMobile.Core"
Title="{Binding TextSource[Led]}"
services:IOC.AutoWireViewModel="true"
ShowMenuButton="false"
ShowNavigateBar="true">
<views:ViewContentBase.Resources>
<ResourceDictionary>
<!-- SelectedLedColorItemTemplate -->
<DataTemplate x:Key="SelectedLedColorItemTemplate">
<shades:Shadows
Margin="0,2,0,0"
BackgroundColor="White"
CornerRadius="40"
HeightRequest="70"
HorizontalOptions="Center"
WidthRequest="70">
<shades:Shadows.Shades>
<shades:ImmutableShades>
<shades:Shade
BlurRadius="10"
Opacity="0.3"
Offset="5,5"
Color="{Binding Source={RelativeSource AncestorType={x:Type local:DeviceLocateSetupLedColorViewModel}}, Path=SelectedLed.Color}" />
<shades:Shade
BindingContext="{Binding}"
BlurRadius="10"
Opacity="0.3"
Offset="-5,-5"
Color="{Binding Source={RelativeSource AncestorType={x:Type local:DeviceLocateSetupLedColorViewModel}}, Path=SelectedLed.Color}" />
<shades:Shade
BindingContext="{Binding}"
BlurRadius="10"
Opacity="0.3"
Offset="-5,5"
Color="{Binding Color}" />
<shades:Shade
BindingContext="{Binding}"
BlurRadius="10"
Opacity="0.3"
Offset="5,-5"
Color="{Binding Color}" />
</shades:ImmutableShades>
</shades:Shadows.Shades>
<border:SfBorder
BorderColor="{StaticResource FiordColor}"
BorderWidth="3"
CornerRadius="25"
HeightRequest="50"
HorizontalOptions="Center"
ShadowColor="{StaticResource ShadowGrayColor}"
VerticalOptions="Center"
WidthRequest="50">
<gradient:SfGradientView BackgroundBrush="{Binding BackgroundGradient}" />
</border:SfBorder>
</shades:Shadows>
</DataTemplate>
<!-- LedColorItemTemplate -->
<DataTemplate x:Key="LedColorItemTemplate">
<ContentView HeightRequest="70" WidthRequest="70">
<border:SfBorder
BorderColor="{StaticResource EntryBackgoundLite}"
BorderWidth="2"
CornerRadius="25"
HeightRequest="50"
HorizontalOptions="Center"
VerticalOptions="Center"
WidthRequest="50">
<gradient:SfGradientView BackgroundBrush="{Binding BackgroundGradient}" />
</border:SfBorder>
</ContentView>
</DataTemplate>
</ResourceDictionary>
</views:ViewContentBase.Resources>
<StackLayout Margin="24">
<scrControls:ScrLabel
Margin="40,0"
CustomFontFamily="SourceSansPro-Regular"
FontSize="16"
HorizontalOptions="CenterAndExpand"
HorizontalTextAlignment="Center"
Text="{Binding TextSource[Led_Explanation]}"
TextColor="{StaticResource LableTextColor}"
VerticalOptions="Start"
VerticalTextAlignment="Center" />
<Image
Margin="0,30,0,0"
Aspect="AspectFit"
HorizontalOptions="FillAndExpand"
Source="{customControls:ImageMultiResource PetActivityMobile.Core.Resources.locate-led-render}"
VerticalOptions="CenterAndExpand" />
<sfList:SfListView
Margin="0"
AutoFitMode="Height"
HorizontalOptions="CenterAndExpand"
IsScrollBarVisible="False"
IsScrollingEnabled="False"
ItemSize="70"
ItemTemplate="{StaticResource LedColorItemTemplate}"
ItemsSource="{Binding LedsColorList}"
SelectedItem="{Binding SelectedLed}"
SelectedItemTemplate="{StaticResource SelectedLedColorItemTemplate}"
SelectionMode="Single"
VerticalOptions="StartAndExpand">
<sfList:SfListView.LayoutManager>
<sfList:GridLayout SpanCount="4" />
</sfList:SfListView.LayoutManager>
</sfList:SfListView>
</StackLayout>
</views:ViewContentBase>
from sharpnado.shadows.
the type here:
AncestorType={x:Type local:DeviceLocateSetupLedColorViewModel}
should be your view model item type, not your parent view model. The one in your LedsColorList
.
from sharpnado.shadows.
tried both of these and still nothing :/
<shades:Shade
BlurRadius="10"
Opacity="0.3"
Offset="5,5"
Color="{Binding Source={RelativeSource AncestorType={x:Type local:SelectedLed}}, Path=Color}" />
<shades:Shade
BindingContext="{Binding}"
BlurRadius="10"
Opacity="0.3"
Offset="-5,-5"
Color="{Binding Source={RelativeSource AncestorType={x:Type local:LedsColorList}}, Path=SelectedLed.Color}"
from sharpnado.shadows.
lol no... not these one.
Ok then show me your DeviceLocateSetupLedColorViewModel
.
from sharpnado.shadows.
Sure:
` public class DeviceLocateSetupLedColorViewModel : ViewModelBase
{
public DeviceLocateSetupLedColorViewModel()
{
InitializeLedColorList();
}
private LedColorModel _selecteLed;
public LedColorModel SelectedLed
{
get => _selecteLed;
set => SetProperty(ref _selecteLed, value);
}
private ObservableCollection<LedColorModel> _ledsColorList;
public ObservableCollection<LedColorModel> LedsColorList
{
get => _ledsColorList;
set => SetProperty(ref _ledsColorList, value);
}
public ICommand ContinueCommand =>
new AsyncCommand(async () =>
{
await OnContinue();
}, null);
public override Task InitializeAsync(object navigationData)
{
return base.InitializeAsync(navigationData);
}
private void InitializeLedColorList()
{
LedsColorList = new ObservableCollection<LedColorModel>
{
new LedColorModel
{
Color = Color.FromHex(Colors.GhostWhite),
BackgroundGradient = AddLinearGradient(Colors.SolideWhite, Colors.GhostWhite)
},
}
private SfLinearGradientBrush AddLinearGradient(string color1, string color2)
{
SfLinearGradientBrush gradient = new SfLinearGradientBrush();
gradient.StartPoint = new Point(0, 0);
gradient.EndPoint = new Point(1, 1);
gradient.GradientStops.Add(new SfGradientStop() { Color = Color.FromHex(color1), Offset = 0 });
gradient.GradientStops.Add(new SfGradientStop() { Color = Color.FromHex(color1), Offset = 0.5 });
gradient.GradientStops.Add(new SfGradientStop() { Color = Color.FromHex(color2), Offset = 0.5 });
gradient.GradientStops.Add(new SfGradientStop() { Color = Color.FromHex(color2), Offset = 1 });
return gradient;
}
private async Task OnContinue()
{
}
}
public class LedColorModel : ExtendedBindableObject
{
public SfLinearGradientBrush BackgroundGradient { get; set; }
//public Color Color { get; set; }
private Color _color;
public Color Color
{
get => _color;
set => SetProperty(ref _color, value);
}
}
`
from sharpnado.shadows.
ok then it's:
Color="{Binding Source={RelativeSource AncestorType={x:Type local:LedColorModel}}, Path=Color}"
from sharpnado.shadows.
still no:/ + there is a Xaml error
from sharpnado.shadows.
Ok then it means we got the syntax wrong, juste give me a repro sample please.
from sharpnado.shadows.
ok.
Xaml:
<views:ViewContentBase
x:Class="PetActivityMobile.Core.Views.DeviceSetup.DeviceLocate.DeviceLocateSetupLedColorView"
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:border="clr-namespace:Syncfusion.XForms.Border;assembly=Syncfusion.Core.XForms"
xmlns:customControls="clr-namespace:PetActivityMobile.Core.CustomControls;assembly=PetActivityMobile.Core"
xmlns:gradient="clr-namespace:Syncfusion.XForms.Graphics;assembly=Syncfusion.Core.XForms"
xmlns:local="clr-namespace:PetActivityMobile.Core.Models.Device.DeviceLocate;assembly=PetActivityMobile.Core"
xmlns:scrControls="clr-namespace:PetActivityMobile.Core.CustomControls.ScrControls;assembly=PetActivityMobile.Core"
xmlns:services="clr-namespace:Infra.Core.Services;assembly=Infra.Core"
xmlns:sfList="clr-namespace:Syncfusion.ListView.XForms;assembly=Syncfusion.SfListView.XForms"
xmlns:shades="clr-namespace:Sharpnado.Shades;assembly=Sharpnado.Shadows"
xmlns:views="clr-namespace:PetActivityMobile.Core.Views.Base;assembly=PetActivityMobile.Core"
Title="{Binding TextSource[Led]}"
services:IOC.AutoWireViewModel="true"
ShowMenuButton="false"
ShowNavigateBar="true">
views:ViewContentBase.Resources
<shades:Shadows
Margin="0,2,0,0"
BackgroundColor="White"
CornerRadius="40"
HorizontalOptions="Center">
shades:Shadows.Shades
shades:ImmutableShades
<shades:Shade
BlurRadius="10"
Opacity="0.3"
Offset="5,5"
Color="{Binding Source={RelativeSource AncestorType={x:Type local:LedColorModel}}, Path=Color}" />
<shades:Shade
BlurRadius="10"
Opacity="0.3"
Offset="-5,-5"
Color="{Binding Source={RelativeSource AncestorType={x:Type local:LedColorModel}}, Path=Color}" />
<shades:Shade
BlurRadius="10"
Opacity="0.3"
Offset="-5,5"
Color="{Binding Source={RelativeSource AncestorType={x:Type local:LedColorModel}}, Path=Color}" />
<shades:Shade
BlurRadius="10"
Opacity="0.3"
Offset="5,-5"
Color="{Binding Source={RelativeSource AncestorType={x:Type local:LedColorModel}}, Path=Color}" />
</shades:ImmutableShades>
</shades:Shadows.Shades>
<border:SfBorder
BorderColor="{StaticResource FiordColor}"
BorderWidth="3"
CornerRadius="25"
HeightRequest="50"
HorizontalOptions="Center"
ShadowColor="{StaticResource ShadowGrayColor}"
VerticalOptions="Center"
WidthRequest="50">
<gradient:SfGradientView BackgroundBrush="{Binding BackgroundGradient}" />
</border:SfBorder>
</shades:Shadows>
</DataTemplate>
<!-- LedColorItemTemplate -->
<DataTemplate x:Key="LedColorItemTemplate">
<ContentView>
<border:SfBorder
BorderColor="{StaticResource EntryBackgoundLite}"
BorderWidth="2"
CornerRadius="25"
HeightRequest="50"
HorizontalOptions="Center"
VerticalOptions="Center"
WidthRequest="50">
<gradient:SfGradientView BackgroundBrush="{Binding BackgroundGradient}" />
</border:SfBorder>
</ContentView>
</DataTemplate>
</ResourceDictionary>
</views:ViewContentBase.Resources>
<StackLayout Margin="24" Spacing="0">
<scrControls:ScrLabel
Margin="20,0"
CustomFontFamily="SourceSansPro-Regular"
FontSize="16"
HorizontalOptions="CenterAndExpand"
HorizontalTextAlignment="Center"
Text="{Binding TextSource[Led_Explanation]}"
TextColor="{StaticResource LableTextColor}"
VerticalOptions="Start"
VerticalTextAlignment="Center" />
<Image
Margin="0,30,0,0"
Aspect="AspectFit"
HorizontalOptions="FillAndExpand"
Source="{customControls:ImageMultiResource PetActivityMobile.Core.Resources.locate-led-render}"
VerticalOptions="CenterAndExpand" />
<sfList:SfListView
HorizontalOptions="CenterAndExpand"
IsScrollBarVisible="False"
IsScrollingEnabled="False"
ItemSize="75"
ItemTemplate="{StaticResource LedColorItemTemplate}"
ItemsSource="{Binding LedsColorList}"
SelectedItem="{Binding SelectedLed}"
SelectedItemTemplate="{StaticResource SelectedLedColorItemTemplate}"
SelectionMode="Single"
VerticalOptions="StartAndExpand">
<sfList:SfListView.LayoutManager>
<sfList:GridLayout SpanCount="4" />
</sfList:SfListView.LayoutManager>
</sfList:SfListView>
<scrControls:ScrButton
Margin="0,0,0,27"
Command="{Binding NextCommand}"
Style="{StaticResource ContinueButtonStyle}"
Text="{Binding TextSource[General_Continue]}"
VerticalOptions="End" />
</StackLayout>
</views:ViewContentBase>
from sharpnado.shadows.
man this is not a repro sample, this is code. I need your whole solution zipped or shared on github.
from sharpnado.shadows.
sorry, this is not an option. this a production app.
is there something else that can help you help me?
from sharpnado.shadows.
stay tuned, I will try something :)
from sharpnado.shadows.
thanks so much, biting my nails with anticipation.
from sharpnado.shadows.
Hi, do you have a workaround in the meantime? I really want to use this package.
from sharpnado.shadows.
Hey, I'm currently fixing the issue, and I will release the package next week.
As soon as I fixed it in the code I will make a beta package for you, to see if it fixes your issue (should be today).
from sharpnado.shadows.
You are the best man!
from sharpnado.shadows.
thanks, how can I test it?
from sharpnado.shadows.
thanks, how can I test it?
Either uninstall nuget and add the source files to your projects or wait for a new release
from sharpnado.shadows.
I prefer to use your official release, do you think that will be soon?
from sharpnado.shadows.
Well, @roubachof promised next week. So hold on)
from sharpnado.shadows.
Please test the attached package (@themronion you can also test to see if your pr was correctly merged)
Sharpnado.Shadows.1.1.0.nupkg.zip
from sharpnado.shadows.
Please test the attached package (@themronion you can also test to see if your pr was correctly merged)
Thanks, I've got a crash when I click on one of the items in the list:
"System.ObjectDisposedException: 'Cannot access a disposed object.
Object name: 'Sharpnado.Shades.Droid.ShadowView'.'"
from sharpnado.shadows.
Could I have the full stack trace please ?
from sharpnado.shadows.
Could I have the full stack trace please ?
from sharpnado.shadows.
Could I have the full stack trace please ?
Here is a link to a Sample Project: https://github.com/AlonRom/Sample.git
Once you click on the selected item it's crashing.
I have tested it on Galaxy S7 (herolte) (SM-G930F)
from sharpnado.shadows.
Thanks for the feedback it helped a lot !
from sharpnado.shadows.
Thanks for the feedback it helped a lot !
Sure :) will you release soon?
from sharpnado.shadows.
new attempt.
Sharpnado.Shadows.1.1.0.nupkg.zip
from sharpnado.shadows.
new attempt.
Sharpnado.Shadows.1.1.0.nupkg.zip
sorry, still the same crash
from sharpnado.shadows.
you need to clear your nuget cache before testing it, cause it has the same version as the previous one
from sharpnado.shadows.
you need to clear your nuget cache before testing it, cause it has the same version as the previous one
can you release it, please?
from sharpnado.shadows.
It won't change a thing for you if I release it, you still have a previous nuget package in your nuget cache. If you don't clear your local cache, it will not update the package.
from sharpnado.shadows.
It won't change a thing for you if I release it, you still have a previous nuget package in your nuget cache. If you don't clear your local cache, it will not update the package.
not sure what you mean, I don't clean my cache when I update a nuget version.
from sharpnado.shadows.
But you are not updating a nuget version in this case since this is the same version.
Anyway it's super easy, just delete this folder.
from sharpnado.shadows.
But you are not updating a nuget version in this case since this is the same version.
Anyway it's super easy, just delete this folder.
I deleted, but I'm still getting error about 1.0.2:
Install-Package : NU1102: Unable to find package Sharpnado.Shadows with version (>= 1.1.0)
- Found 3 version(s) in nuget-group [ Nearest version: 1.0.2 ]
At line:1 char:1
- Install-Package C:....p\Sharpnado.Shadows.1.1.0.nu ...
-
+ CategoryInfo : NotSpecified: (:) [Install-Package], Exception + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
Install-Package : Package restore failed. Rolling back package changes for 'PetActivityMobile.Droid'.
At line:1 char:1
- Install-Package C:....harpnado.Shadows.1.1.0.nu ...
-
+ CategoryInfo : NotSpecified: (:) [Install-Package], Exception + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
from sharpnado.shadows.
Put the unzipped package in a folder and add this folder as a local nuget storage.
from sharpnado.shadows.
Hi I am on version 1.2.0, and still this issue persists.
Error XFC0009: No property, BindableProperty, or event found for "Color", or mismatching type between value and property. (XFC0009)
<sh:Shadows Shades="{sh:SingleShade Offset='0,0',
Opacity=0.15,
BlurRadius=4,
Color={Binding Source={RelativeSource AncestorType={x:Type vm:SomeViewModel}}, Path= EventBoxColor}}" >
OnViewModel
public Color EventBoxColor { get => Color.FromHex("#A56262"); }
from sharpnado.shadows.
Sorry this is not the same issue
from sharpnado.shadows.
@roubachof So can you give me hints on how to solve this, BTW, I tried adding color with StaticResource in Xaml and it worked.
from sharpnado.shadows.
Related Issues (20)
- [Bug][UWP] White Background added inside Shadow element when using SingleShade. HOT 3
- Shade ColorBindableProperty is not Dynamic ! HOT 6
- Very bad performance on Android HOT 8
- Colored Neumorphism HOT 2
- Can you please release a version for mac? HOT 1
- [Question] Adding shadow in Code Behind HOT 4
- Shadow works only with iOS HOT 6
- Shadow White Box HOT 2
- Java.Lang.OutOfMemoryError on Android HOT 7
- [Enhancement] Inner Shadows
- Crash: ShadowView.CreateBitmap: java.lang.nullpointerException HOT 3
- How-To: offset (0,-15) but bottom padding causes shadow on the lower side HOT 1
- [Bug] Super weird behavior with Material button
- Shadow binding stopped working in 1.2.0 version (worked in 1.1.0) HOT 21
- Possible to dynamically change properties on a shade using DataTriggers?
- Support MAUI HOT 7
- Strict mode - ShadowView LeakedClosableViolation
- [BUG] udating to XamarinFrom 5.0.0.2291 InvalidOperationException "Invalid on Color.Default"
- iOS shadows do not have the correct color after updating Sharpnado.Shadows Nuget
- Maui support? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sharpnado.shadows.