첨부 실행 코드는 나눔고딕코딩 폰트를 사용합니다.
728x90
반응형
728x170

TestProject.zip
0.18MB

▶ Element.cs

namespace TestProject
{
    /// <summary>
    /// 엘리먼트
    /// </summary>
    public class Element
    {
        //////////////////////////////////////////////////////////////////////////////////////////////////// Property
        ////////////////////////////////////////////////////////////////////////////////////////// Public

        #region 명칭 - Name

        /// <summary>
        /// 명칭
        /// </summary>
        public string Name { get; set; }

        #endregion
    }
}

 

728x90

 

▶ MainPage.xaml

<Page x:Class="TestProject.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:TestProject"
    Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
    FontFamily="나눔고딕코딩"
    FontSize="16">
    <Grid>
        <Grid Margin="10">
            <ParallaxView Name="parallaxView"
                VerticalShift="500"
                Source="{Binding ElementName=listView}">
                <Image Source="ms-appx:///IMAGE/cliff.jpg" />
            </ParallaxView>
            <ListView Name="listView"
                Background="#80000000">
                <ListView.ItemTemplate>
                    <DataTemplate x:DataType="local:Element">
                        <TextBlock
                            Foreground="White"
                            Text="{x:Bind Name}" />
                    </DataTemplate>
                </ListView.ItemTemplate>
                <ListView.Header>
                    <TextBlock
                        HorizontalAlignment="Center"
                        VerticalAlignment="Center"
                        MaxWidth="400"
                        Foreground="White"
                        TextWrapping="WrapWholeWords"
                        FontSize="28"
                        Text="이미지의 시차를 보기 위해서 목록을 스크롤 합니다." />
                </ListView.Header>
            </ListView>
        </Grid>
    </Grid>
</Page>

 

300x250

 

▶ MainPage.xaml.cs

using System.Collections.Generic;
using Windows.Foundation;
using Windows.Graphics.Display;
using Windows.UI.ViewManagement;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Navigation;

namespace TestProject
{
    /// <summary>
    /// 메인 페이지
    /// </summary>
    public sealed partial class MainPage : Page
    {
        //////////////////////////////////////////////////////////////////////////////////////////////////// Constructor
        ////////////////////////////////////////////////////////////////////////////////////////// Public

        #region 생성자 - MainPage()

        /// <summary>
        /// 생성자
        /// </summary>
        public MainPage()
        {
            InitializeComponent();

            #region 윈도우 크기를 설정한다.

            double width  = 800d;
            double height = 600d;

            double dpi = (double)DisplayInformation.GetForCurrentView().LogicalDpi;

            ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.PreferredLaunchViewSize;

            Size windowSize = new Size(width * 96d / dpi, height * 96d / dpi);

            ApplicationView.PreferredLaunchViewSize = windowSize;

            Window.Current.Activate();

            ApplicationView.GetForCurrentView().TryResizeView(windowSize);

            #endregion
            #region 윈도우 제목을 설정한다.

            ApplicationView.GetForCurrentView().Title = "ParallaxView 엘리먼트 사용하기";

            #endregion
        }

        #endregion

        //////////////////////////////////////////////////////////////////////////////////////////////////// Method
        ////////////////////////////////////////////////////////////////////////////////////////// Private

        #region 탐색되는 경우 처리하기 - OnNavigatedTo(e)

        /// <summary>
        /// 탐색되는 경우 처리하기
        /// </summary>
        /// <param name="e">이벤트 인자</param>
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            List<Element> list = new List<Element>();

            list.Add(new Element() { Name = "Acrylic"               });
            list.Add(new Element() { Name = "AnimatedVisualPlayer"  });
            list.Add(new Element() { Name = "Animation interop"     });
            list.Add(new Element() { Name = "AppBarButton"          });
            list.Add(new Element() { Name = "AppBarSeparator"       });
            list.Add(new Element() { Name = "AppBarToggleButton"    });
            list.Add(new Element() { Name = "AutomationProperties"  });
            list.Add(new Element() { Name = "AutoSuggestBox"        });
            list.Add(new Element() { Name = "Border"                });
            list.Add(new Element() { Name = "Button"                });
            list.Add(new Element() { Name = "CalendarDatePicker"    });
            list.Add(new Element() { Name = "CalendarView"          });
            list.Add(new Element() { Name = "Canvas"                });
            list.Add(new Element() { Name = "CheckBox"              });
            list.Add(new Element() { Name = "ColorPaletteResources" });
            list.Add(new Element() { Name = "ColorPicker"           });
            list.Add(new Element() { Name = "ComboBox"              });
            list.Add(new Element() { Name = "CommandBar"            });
            list.Add(new Element() { Name = "CommandBarFlyout"      });
            list.Add(new Element() { Name = "Compact Sizing"        });
            list.Add(new Element() { Name = "Connected Animation"   });
            list.Add(new Element() { Name = "ContentDialog"         });
            list.Add(new Element() { Name = "DataGrid"              });
            list.Add(new Element() { Name = "DatePicker"            });
            list.Add(new Element() { Name = "DropDownButton"        });
            list.Add(new Element() { Name = "Easing Functions"      });
            list.Add(new Element() { Name = "FlipView"              });
            list.Add(new Element() { Name = "Flyout"                });
            list.Add(new Element() { Name = "Grid"                  });
            list.Add(new Element() { Name = "GridView"              });
            list.Add(new Element() { Name = "HyperlinkButton"       });
            list.Add(new Element() { Name = "Image"                 });
            list.Add(new Element() { Name = "Implicit Transitions"  });
            list.Add(new Element() { Name = "InfoBar"               });
            list.Add(new Element() { Name = "InkCanvas"             });
            list.Add(new Element() { Name = "InkToolbar"            });
            list.Add(new Element() { Name = "ItemsRepeater"         });
            list.Add(new Element() { Name = "ListBox"               });
            list.Add(new Element() { Name = "ListView"              });
            list.Add(new Element() { Name = "MediaPlayerElement"    });
            list.Add(new Element() { Name = "MenuBar"               });
            list.Add(new Element() { Name = "MenuFlyout"            });
            list.Add(new Element() { Name = "NavigationView"        });
            list.Add(new Element() { Name = "NumberBox"             });
            list.Add(new Element() { Name = "Page Transitions"      });
            list.Add(new Element() { Name = "ParallaxView"          });
            list.Add(new Element() { Name = "PasswordBox"           });
            list.Add(new Element() { Name = "PersonPicture"         });
            list.Add(new Element() { Name = "Pivot"                 });
            list.Add(new Element() { Name = "ProgressBar"           });
            list.Add(new Element() { Name = "ProgressRing"          });
            list.Add(new Element() { Name = "PullToRefresh"         });
            list.Add(new Element() { Name = "RadialGradientBrush"   });
            list.Add(new Element() { Name = "RadioButton"           });
            list.Add(new Element() { Name = "RadioButtons"          });
            list.Add(new Element() { Name = "RatingControl"         });
            list.Add(new Element() { Name = "RelativePanel"         });
            list.Add(new Element() { Name = "RepeatButton"          });
            list.Add(new Element() { Name = "Reveal"                });
            list.Add(new Element() { Name = "Reveal Focus"          });
            list.Add(new Element() { Name = "RichEditBox"           });
            list.Add(new Element() { Name = "RichTextBlock"         });
            list.Add(new Element() { Name = "ScrollViewer"          });
            list.Add(new Element() { Name = "SemanticZoom"          });
            list.Add(new Element() { Name = "Slider"                });
            list.Add(new Element() { Name = "Sound"                 });
            list.Add(new Element() { Name = "SplitButton"           });
            list.Add(new Element() { Name = "SplitView"             });
            list.Add(new Element() { Name = "StackPanel"            });
            list.Add(new Element() { Name = "StandardUICommand"     });
            list.Add(new Element() { Name = "SwipeControl"          });
            list.Add(new Element() { Name = "TabView"               });
            list.Add(new Element() { Name = "TeachingTip"           });
            list.Add(new Element() { Name = "TextBlock"             });
            list.Add(new Element() { Name = "TextBox"               });
            list.Add(new Element() { Name = "Theme Transitions"     });
            list.Add(new Element() { Name = "TimePicker"            });
            list.Add(new Element() { Name = "ToggleButton"          });
            list.Add(new Element() { Name = "ToggleSplitButton"     });
            list.Add(new Element() { Name = "ToggleSwitch"          });
            list.Add(new Element() { Name = "ToolTip"               });
            list.Add(new Element() { Name = "TreeView"              });
            list.Add(new Element() { Name = "VariableSizedWrapGrid" });
            list.Add(new Element() { Name = "ViewBox"               });
            list.Add(new Element() { Name = "WebView"               });
            list.Add(new Element() { Name = "XamlUICommand"         });

            this.listView.ItemsSource = list;
        }

        #endregion
    }
}
728x90
반응형
그리드형(광고전용)
Posted by icodebroker

댓글을 달아 주세요