Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use Static properties #50

Closed
fmonroe opened this issue Oct 3, 2017 · 1 comment
Closed

How to use Static properties #50

fmonroe opened this issue Oct 3, 2017 · 1 comment

Comments

@fmonroe
Copy link

fmonroe commented Oct 3, 2017

Here is what I have:

<Window x:Class="MySuperApp.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:MySuperApp"
        mc:Ignorable="d"
        xmlns:sys="clr-namespace:System;assembly=mscorlib"
        d:DataContext="{d:DesignInstance {x:Type dvm:DesignMainWindowViewModel}, IsDesignTimeCreatable=True}"
        xmlns:c="clr-namespace:CalcBinding;assembly=CalcBinding"
        Title="{Binding Title}"
        x:Name="this_" d:DesignWidth="1600" d:DesignHeight="900">

    <Window.Resources>

        <sys:Double x:Key="IconHeigh">55</sys:Double>
        <sys:Double x:Key="IconWidth">55</sys:Double>
...
    </Window.Resources>

and then :
<Path Stretch="Uniform" Fill="Black" Height="{c:Binding 'local:IconHeigh - 10'}" Data="M15,... ,2,0z" />
The binding expression is wrong - I can't figure out what it should be. Can you help please?

@Alex141
Copy link
Owner

Alex141 commented Oct 3, 2017

For static properties syntax see:
See https://github.com/Alex141/CalcBinding#2-static-properties
Form of static property: namespace:Class.Property, e.g. 'local:Icon.IconHeigh - 10'

In your xaml you want to use not static property but StaticResource, which is not supported, sorry

@Alex141 Alex141 closed this as completed Nov 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants