Merhabalar UWP üzerinde ResourceDictionary üzerinden Binding yapmak istiyorum, yani kısaca .cs dosyasından tanımlamış olduğum değişken içeriğini çekmek istiyorum. Bunu nasıl yapabilirim? Denemiş olduğum yöntem:
CS:
private static int _PlankButtonImageSize = 40;
public static int PlankButtonImageSize
{
get { return _PlankButtonImageSize; }
set { _PlankButtonImageSize = value; }
}
XAML:
<Setter Property="Height" Value="{x:Bind local:MainPage.PlankButtonImageSize}"/>
<Setter Property="Width" Value="{x:Bind local:MainPage.PlankButtonImageSize}"/>
Hata Kodu: This Xaml file must have a code-behind class to use {x:Bind}.
CS:
private static int _PlankButtonImageSize = 40;
public static int PlankButtonImageSize
{
get { return _PlankButtonImageSize; }
set { _PlankButtonImageSize = value; }
}
XAML:
<Setter Property="Height" Value="{x:Bind local:MainPage.PlankButtonImageSize}"/>
<Setter Property="Width" Value="{x:Bind local:MainPage.PlankButtonImageSize}"/>
Hata Kodu: This Xaml file must have a code-behind class to use {x:Bind}.
Son düzenleyen: Moderatör: