Cannot set canvas.top/left with binding in ItemControl UWP
<p>I want to make simple game like a snake in UWP 10 , and i want binding to rectangles in my view model observation list. I try do this , but it's not work correctly. In my XAML code i got three problem in:
Binding X
Binding Y
Binding RectItems</p>

<p>(Cannot resolve symbol ... due to unknow DataContext. I added my view model to context in constructor of page with xaml code so i don't know what is a problem ? Binding to Height and Width work good and i getting rectangle but all in the same position. </p>

<p>This is my XAML code: </p>

<pre><code>    &lt;Grid Grid.Row="1" Grid.Column="1"&gt;
        &lt;ItemsControl ItemsSource="{Binding RectItems}"&gt;
            &lt;ItemsControl.ItemsPanel&gt;
            &lt;ItemsPanelTemplate&gt;
                &lt;Canvas  Background="Aqua"/&gt;
            &lt;/ItemsPanelTemplate&gt;
        &lt;/ItemsControl.ItemsPanel&gt;

            &lt;ItemsControl.ItemContainerStyle &gt;
            &lt;Style TargetType="ContentPresenter"&gt;
                &lt;Setter Property="Canvas.Left" Value="{Binding X}"/&gt;
                    &lt;Setter Property="Canvas.Top" Value="{Binding Y}"/&gt;
                &lt;/Style&gt;
        &lt;/ItemsControl.ItemContainerStyle&gt;

        &lt;ItemsControl.ItemTemplate&gt;
            &lt;DataTemplate&gt;
                &lt;Rectangle Width="{Binding Width}" Height="{Binding Height}" Fill="Black"/&gt;
            &lt;/DataTemplate&gt;
        &lt;/ItemsControl.ItemTemplate&gt;
    &lt;/ItemsControl&gt;
    &lt;/Grid&gt;
</code></pre>

<p>View Model:</p>

<pre><code>public class GameViewModel:INotifyPropertyChanged
{
    public ObservableCollection&lt;RectItem&gt; RectItems { get; set; }

    public GameViewModel()
    {
        RectItems=new ObservableCollection&lt;RectItem&gt;();
        RectItem rect =new RectItem() {X=50,Y=60,Width=30,Height=20}; // all properties are public double type
        RectItems.Add(rect);
    }

    public event PropertyChangedEventHandler PropertyChanged;

    [NotifyPropertyChangedInvocator]
    protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
    {
        PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
    }
}
</code></pre>