<TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="TextBlock" VerticalAlignment="Top"/>
2013年6月21日 星期五
[Windows 8] How to set TextBlock and TextBox to wrap in XAML
TextBlock and TextBox by setting TextWrapping = "Wrap" attribute to make the text exceeds the width of the control automatically wrap. The default is nowrap.
2013年6月18日 星期二
[Windows 8] How to check windows 8 UI modes by C#
Sample:
using Windows.UI.ViewManagement;
private void pageRoot_SizeChanged(object sender, SizeChangedEventArgs e)
{
ApplicationViewState viewState = ApplicationView.Value;
if (viewState == ApplicationViewState.Filled)
{
System.Diagnostics.Debug.WriteLine("viewState is Filled");
}
else if (viewState == ApplicationViewState.FullScreenLandscape)
{
System.Diagnostics.Debug.WriteLine("viewState is FullScreenLandscape");
}
else if (viewState == ApplicationViewState.Snapped)
{
System.Diagnostics.Debug.WriteLine("viewState is Snapped");
}
else if (viewState == ApplicationViewState.FullScreenPortrait)
{
System.Diagnostics.Debug.WriteLine("viewState is FullScreenPortrait");
}
else
{
System.Diagnostics.Debug.WriteLine("viewState is something unexpected");
}
}
[Windows 8] How to create a circle mask image with XAML
The example creates an ImageBrush and sets the ImageSource to an image named people.png, which you must include as a resource in the app. The ImageBrush then paints the area defined by an Ellipse shape.
<Ellipse Height="200" Width="200">
<Ellipse.Fill>
<ImageBrush ImageSource="people.png" />
</Ellipse.Fill>
</Ellipse>
Result:
Reference:
Quickstart: Using brushes (Windows Store apps using C#/VB/C++ and XAML)
2013年6月4日 星期二
[DirectX] Solution: Error code S1023 installing DirectX SDK on Windows 7
The solution:
(2) Install the DirectX SDK (June 2010)
(1) Remove the Visual C++ 2010 Redistributable Package version 10.0.40219 (Service Pack 1) from the system (both x86 and x64 if applicable). This can be easily done via a command-line with administrator rights:
MsiExec.exe /passive /X{F0C3E5D1-1ADE-321E-8167-68EF0DE699A5}
MsiExec.exe /passive /X{1D8E6291-B0D5-35EC-8441-6616F567A0F7}
(2) Install the DirectX SDK (June 2010)
(3) Reinstall the Visual C++ 2010 Redistributable Package version 10.0.40219 (Service Pack 1). On an x64 system, you should install both the x86 and x64 versions of the C++ REDIST. Be sure to install the most current version available, which at this point is the KB 2565063 with a security fix.
Reference:
Known Issue: DirectX SDK (June 2010) Setup and the S1023 error2013年5月26日 星期日
統一發票 102年03-04月中獎號碼
| 獎別 | 中獎號碼 |
|---|---|
| 特別獎 1,000 萬元 |
13393774 同期統一發票收執聯8位數號碼與上列號碼相同者獎金1,000 萬元 |
| 特獎 200 萬元 |
25894576 同期統一發票收執聯8位數號碼與上列號碼相同者獎金200 萬元 |
| 頭獎 20 萬元 |
43792479、01973003、71347425 同期統一發票收執聯8位數號碼與上列號碼相同者獎金20 萬元 |
| 二獎 4 萬元 |
同期統一發票收執聯末7 位數號碼與頭獎中獎號碼末7 位相同者各得獎金4 萬元 |
| 三獎 1 萬元 |
同期統一發票收執聯末6 位數號碼與頭獎中獎號碼末6 位相同者各得獎金1 萬元 |
| 四獎 4 千元 |
同期統一發票收執聯末5 位數號碼與頭獎中獎號碼末5 位相同者各得獎金4 千元 |
| 五獎 1 千元 |
同期統一發票收執聯末4 位數號碼與頭獎中獎號碼末4 位相同者各得獎金1 千元 |
| 六獎 2 百元 |
同期統一發票收執聯末3 位數號碼與頭獎中獎號碼末3 位相同者各得獎金2 百元 |
| 增開六獎 2 百元 |
997 同期統一發票收執聯末3 位數號碼與上列號碼相同者各得獎金2 百元 |
領獎期間自102年06月6日起至102年09月5日止
2013年5月22日 星期三
[Windows 8] How to set the Item to bring into view with ListView in Windows Store app
You can use the following function:
Scrolls the list to bring the specified data item into view.
Type: System.Object [.NET] | Platform::Object [C++]
The data item to bring into view.
Scrolls the list to bring the specified data item into view.
public void ScrollIntoView(
object item
)
Parameters
itemType: System.Object [.NET] | Platform::Object [C++]
The data item to bring into view.
Sample
int nPos = 5;
listView.ItemsSource = list;
listView.UpdateLayout();
listView.ScrollIntoView(list[nPos]);
2013年5月21日 星期二
[Windows 8] How to make Metro ListView selection color modification in XAML
Add the following xaml tag
to StandardStyles.xaml file, and reference the following:
<SolidColorBrush x:Key="ListViewItemSelectedBackgroundThemeBrush" Color="#FF8FC249"/>
<SolidColorBrush x:Key="ListViewItemSelectedPointerOverBackgroundThemeBrush" Color="#DE8FC249"/>
<SolidColorBrush x:Key="ListViewItemSelectedPointerOverBorderThemeBrush" Color="#AB8FC249"/>
to StandardStyles.xaml file, and reference the following:
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!-- Non-brush values that vary across themes -->
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Default">
<x:String x:Key="BackButtonGlyph"></x:String>
<x:String x:Key="BackButtonSnappedGlyph"></x:String>
</ResourceDictionary>
<ResourceDictionary x:Key="HighContrast">
<x:String x:Key="BackButtonGlyph"></x:String>
<x:String x:Key="BackButtonSnappedGlyph"></x:String>
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>
<x:String x:Key="ChevronGlyph"></x:String>
<SolidColorBrush x:Key="ListViewItemSelectedBackgroundThemeBrush" Color="#FF8FC249"/>
<SolidColorBrush x:Key="ListViewItemSelectedPointerOverBackgroundThemeBrush" Color="#DE8FC249"/>
<SolidColorBrush x:Key="ListViewItemSelectedPointerOverBorderThemeBrush" Color="#AB8FC249"/>
...
</ResourceDictionary>
訂閱:
文章 (Atom)
