[NUI] Add xaml and xamlbing testcases
[platform/core/csapi/tizenfx.git] / test / Tizen.NUI.Tests / Tizen.NUI.Devel.Tests / res / layout / BindingSample.xaml
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <View x:Class="Tizen.NUI.Devel.Tests.BindingSample"
3   xmlns="http://tizen.org/Tizen.NUI/2018/XAML"
4   xmlns:l="clr-namespace:Tizen.NUI.Devel.Tests;assembly=Tizen.NUI.Devel.Tests"
5   xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml">
6
7     <View.XamlResources>
8         <ResourceDictionary>
9             <l:FloatToBoolConverter x:Key="floatToBool" />
10             <l:FloatToIntConverter x:Key="floatToInt" />
11         </ResourceDictionary>
12     </View.XamlResources>
13
14     <View x:Name="view1" BackgroundColor="Red" SizeWidth="100" SizeHeight="100" Sensitive="true" />
15     <TextLabel PositionX="200" PositionY="500" Ellipsis="{Binding Source={x:Reference view1}, Path=SizeWidth, Converter={StaticResource floatToBool}}" />
16     <TextLabel>
17         <TextLabel.Text>
18             <Binding Source="{x:Reference view1}" Path="Sensitive">
19                 <Binding.Converter>
20                     <l:BoolToObjectConverter x:TypeArguments="x:String" TrueObject="Of course!" FalseObject="No way!" />
21                 </Binding.Converter>
22             </Binding>
23         </TextLabel.Text>
24     </TextLabel>
25     <TextLabel Text="{Binding Red, Converter={StaticResource floatToInt}, ConverterParameter=255, StringFormat='Red = {0:X2}'}" >
26         <TextLabel.BindingContext>
27             <l:RgbColorViewModel Color="Red" />
28         </TextLabel.BindingContext>
29     </TextLabel>
30 </View>