Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <Button x:Name="MoveImagesBack" Click="MoveImagesBack_Click" Style="{StaticResource MoveImagesButton}" Content="<"/>
- <ListBox ItemsSource="{Binding Path=GamesImages}" x:Name="LoopPhotoCarousel" Margin="0 10" Grid.Column="1"
- ScrollViewer.HorizontalScrollBarVisibility="Hidden" ScrollViewer.VerticalScrollBarVisibility="Hidden"
- BorderThickness="0"
- >
- <ListBox.ItemsPanel>
- <ItemsPanelTemplate>
- <StackPanel Orientation="Horizontal"/>
- </ItemsPanelTemplate>
- </ListBox.ItemsPanel>
- <ListBox.ItemContainerStyle>
- <Style TargetType="ListBoxItem">
- <Setter Property="Width" Value="200"/>
- <Setter Property="Height" Value="120"/>
- <Setter Property="Margin" Value="10 0"/>
- </Style>
- </ListBox.ItemContainerStyle>
- <ListBox.ItemTemplate>
- <DataTemplate>
- <StackPanel>
- <Image Source="{Binding}"/>
- </StackPanel>
- </DataTemplate>
- </ListBox.ItemTemplate>
- </ListBox>
- <Button Grid.Column="2" Style="{StaticResource MoveImagesButton}" Content=">"></Button>
- ObservableCollection<string> gamesImages = new ObservableCollection<string>();
- public ObservableCollection<string> GamesImages
- {
- get
- {
- if (gamesImages.Count <= 0)
- {
- gamesImages.Add(@"Images/Games/1.jpg");
- gamesImages.Add(@"Images/Games/2.jpg");
- gamesImages.Add(@"Images/Games/3.jpg");
- gamesImages.Add(@"Images/Games/4.jpg");
- gamesImages.Add(@"Images/Games/5.jpg");
- gamesImages.Add(@"Images/Games/6.jpg");
- }
- return gamesImages;
- }
- }
- public partial class MainWindow : Window
- {
- public MainWindow()
- {
- InitializeComponent();
- this.DataContext = new MainWindowViewModel(this);
- }
- }
Add Comment
Please, Sign In to add comment