ToonWK
Topic Author
Posts: 4
Joined: 20 Jun 2017, 16:43

How can I get item on the xaml

21 Jun 2017, 20:43

Sound like a simple question to everyone else.

But for me, I tried look through the document. And I don't see any document mentioned about it.

Or try to search on the Google or Bing but the result is something else, not relate to Noesis gui at all.

I also try youtube tutorial. And I saw there was one that do actually what I want. But it does not work anymore, as it was 3 years old.

So I hope if anyone know please help me, how can I get an object. Any object on the UI

Like this UI for example:
<UserControl x:Class="App.Assets.View.ThePage" <!--some other reference--> x:Name="mainUI">
<Grid x:Name="backgroundPage">
        <Grid VerticalAlignment="Center">
            <Grid.RowDefinitions>
                <RowDefinition Height="120"/>
                <RowDefinition Height="80"/>
                <RowDefinition Height="40"/>
            </Grid.RowDefinitions>
            <Button x:Name="start" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Center" Width="120" Height="80">
                <TextBlock Foreground="Green" FontSize="48" Text="Go">
            </Button>
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Grid.Row="2">
                <Button x:Name="setting" Width="60" Height="40">
                    <TextBlock Foreground="Blue" FontSize="24" Text="?"/>
                </Button>
                <Button x:Name="exit" Width="60" Height="40">
                    <TextBlock Foreground="Red" FontSize="24" Text="x"/>
                </Button>
            </StackPanel>
        </Grid>
    </Grid>
</UserControl>
How can I get backgroundPage grid or setting button or something else like StoryBoard or VisualState etc.

PS: I also curious if it possible to use x:Bind instead of Binding. I really love x:Bind as I was once worked on Windows 10 universal app project, and it show any bindable property instantly
 
User avatar
jsantos
Site Admin
Posts: 2905
Joined: 20 Jan 2012, 17:18
Contact:

Re: How can I get item on the xaml

22 Jun 2017, 15:41

Hi!

You should use FindName as explained in this tutorial. Our Unity component gives you access to the root of the loaded XAML. For that root you can get access to any named element. Please, let me know if you don't solve this and I will paste you the exact code. With the previous instructions it should be easy.

We don't support x:Bind for now. That's something we could evaluate for future version. Anyway, bindings are a lot faster in Noesis than WPF.
 
ToonWK
Topic Author
Posts: 4
Joined: 20 Jun 2017, 16:43

Re: How can I get item on the xaml

23 Jun 2017, 12:09

Hi!

You should use FindName as explained in this tutorial. Our Unity component gives you access to the root of the loaded XAML. For that root you can get access to any named element. Please, let me know if you don't solve this and I will paste you the exact code. With the previous instructions it should be easy.

We don't support x:Bind for now. That's something we could evaluate for future version. Anyway, bindings are a lot faster in Noesis than WPF.
Thank you! <3

Who is online

Users browsing this forum: No registered users and 1 guest