Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dd4dab6
commit 287de1a
Showing
7 changed files
with
117 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<UserControl x:Class="AkavacheExplorer.Views.ImageValueView" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
mc:Ignorable="d" x:Name="userControl" | ||
d:DesignHeight="300" d:DesignWidth="300"> | ||
|
||
<Grid DataContext="{Binding ViewModel, ElementName=userControl}"> | ||
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Hidden"> | ||
<Grid> | ||
<Image Source="{Binding Image}" Visibility="{Binding ImageVisibility}" HorizontalAlignment="Center" VerticalAlignment="Center" /> | ||
<TextBlock Text="Couldn't load this as an image" HorizontalAlignment="Center" VerticalAlignment="Center" Visibility="{Binding ErrorVisibility}" /> | ||
</Grid> | ||
</ScrollViewer> | ||
</Grid> | ||
</UserControl> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Windows; | ||
using System.Windows.Controls; | ||
using System.Windows.Data; | ||
using System.Windows.Documents; | ||
using System.Windows.Input; | ||
using System.Windows.Media; | ||
using System.Windows.Media.Imaging; | ||
using System.Windows.Navigation; | ||
using System.Windows.Shapes; | ||
using AkavacheExplorer.ViewModels; | ||
using ReactiveUI.Routing; | ||
|
||
namespace AkavacheExplorer.Views | ||
{ | ||
/// <summary> | ||
/// Interaction logic for ImageValueView.xaml | ||
/// </summary> | ||
public partial class ImageValueView : UserControl, IViewForViewModel<ImageValueViewModel> | ||
{ | ||
public ImageValueView() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
public ImageValueViewModel ViewModel { | ||
get { return (ImageValueViewModel)GetValue(ViewModelProperty); } | ||
set { SetValue(ViewModelProperty, value); } | ||
} | ||
public static readonly DependencyProperty ViewModelProperty = | ||
DependencyProperty.Register("ViewModel", typeof(ImageValueViewModel), typeof(ImageValueView), new UIPropertyMetadata(null)); | ||
|
||
object IViewForViewModel.ViewModel { | ||
get { return ViewModel; } | ||
set { ViewModel = (ImageValueViewModel) value; } | ||
} | ||
} | ||
} |