Skip to content

Instantly share code, notes, and snippets.

@smchughinfo
Created August 1, 2018 12:39
Show Gist options
  • Save smchughinfo/e4368d8aeb964bb68824ff07163e9b2a to your computer and use it in GitHub Desktop.
Save smchughinfo/e4368d8aeb964bb68824ff07163e9b2a to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:App5"
xmlns:ViewModels="clr-namespace:App5.ViewModels"
x:Class="App5.MainPage">
<ContentPage.BindingContext>
<ViewModels:MainViewModel />
</ContentPage.BindingContext>
<StackLayout>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="3*" />
</Grid.ColumnDefinitions>
<Image Source="{Binding NiceImage}" Aspect="AspectFit" Grid.Column="0" />
</Grid>
<Label Text="test" />
</StackLayout>
</ContentPage>
using PropertyDependencyDemo.Mvvm;
using System;
using System.Collections.Generic;
using System.Text;
using Xamarin.Forms;
namespace App5.ViewModels
{
public class MainViewModel : ObservableObject
{
public ImageSource NiceImage
{
get
{
return "anImage.png";
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment