- [MainPage.xaml]소스코드와 [RiaScrollViewerTestPage.html] 소스코드를 아래 형광펜 칠해진 부분과 같이 수정하여, 웹페이지 전체에서 일부분의 실버라이트영역만 지정하고 ScrollViewer 컨트롤을 사용하여 지정된 실버라이트 영역만 본다.






[MainPage.xaml]


<UserControl x:Class="RiaScrollViewer.MainPage"

    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"

    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"

    mc:Ignorable="d"

    d:DesignHeight="100" d:DesignWidth="300">

 

    <Grid x:Name="LayoutRoot" Background="White">

        <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">

            <TextBlock FontSize="72">

                <Run>안녕하세요.</Run>

                <LineBreak></LineBreak>

                <Run>반갑습니다. 또 만나요.</Run>

            </TextBlock>

        </ScrollViewer>

    </Grid>

</UserControl>








[RiaScrollViewerTestPage.html 소스코드 수정]


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >

 

<head>

    <title>RiaScrollViewer</title>

    <style type="text/css">

    html, body {

            height: 100%;

            overflow: auto;

    }

    body {

            padding: 0;

            margin: 0;

    }

    #silverlightControlHost {

            width: 300px;

            height: 100px;

            text-align:center;

    }

    </style>










[실행결과]

--> [RiaScrollViewerTestPage.html]에서 "브라우저에서 보기"로 실행했을 때의 화면.






Posted by holland14
: