Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
WPF勉強会 第4回 スタイルの初歩/WPFStudy4
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
hachiilcane
March 01, 2022
Programming
0
130
WPF勉強会 第4回 スタイルの初歩/WPFStudy4
WPF勉強会 第4回 スタイルの初歩
説明後に実演するライブコーディングのコードはこちら。
https://github.com/hachiilcane/WpfStudy
hachiilcane
March 01, 2022
Tweet
Share
More Decks by hachiilcane
See All by hachiilcane
機械学習勉強会01 1次関数での回帰分析/MLStudy01
hachiilcane
0
60
機械学習勉強会02 多項式近似と最小二乗法による推定/MLStudy02
hachiilcane
0
77
機械学習勉強会03 最急降下法/MLStudy03
hachiilcane
0
37
機械学習勉強会04 偏微分と連鎖律/MLStudy04
hachiilcane
0
41
機械学習勉強会05 パーセプトロン/MLStudy05
hachiilcane
0
41
機械学習勉強会06 ロジスティック回帰/MLStudy06
hachiilcane
0
56
機械学習勉強会07 ROC曲線/MLStudy07
hachiilcane
0
39
機械学習勉強会08 2次元入力3クラス分類/MLStudy08
hachiilcane
0
66
機械学習勉強会09 2層フィードフォワードニューラルネット/MLStudy09
hachiilcane
0
69
Other Decks in Programming
See All in Programming
なるべく楽してバックエンドに型をつけたい!(楽とは言ってない)
hibiki_cube
0
140
AIによるイベントストーミング図からのコード生成 / AI-powered code generation from Event Storming diagrams
nrslib
2
1.8k
AIによる高速開発をどう制御するか? ガードレール設置で開発速度と品質を両立させたチームの事例
tonkotsuboy_com
7
2k
dchart: charts from deck markup
ajstarks
3
990
カスタマーサクセス業務を変革したヘルススコアの実現と学び
_hummer0724
0
650
AtCoder Conference 2025
shindannin
0
1k
生成AIを使ったコードレビューで定性的に品質カバー
chiilog
1
250
AI前提で考えるiOSアプリのモダナイズ設計
yuukiw00w
0
220
MUSUBIXとは
nahisaho
0
130
そのAIレビュー、レビューしてますか? / Are you reviewing those AI reviews?
rkaga
6
4.5k
疑似コードによるプロンプト記述、どのくらい正確に実行される?
kokuyouwind
0
380
開発者から情シスまで - 多様なユーザー層に届けるAPI提供戦略 / Postman API Night Okinawa 2026 Winter
tasshi
0
200
Featured
See All Featured
Skip the Path - Find Your Career Trail
mkilby
0
53
Six Lessons from altMBA
skipperchong
29
4.1k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.4k
A Tale of Four Properties
chriscoyier
162
24k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
320
Product Roadmaps are Hard
iamctodd
PRO
55
12k
WENDY [Excerpt]
tessaabrams
9
36k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
How to Talk to Developers About Accessibility
jct
2
130
Transcript
WPFษڧձ ୈ̐ճ ελΠϧͷॳา
ࠓ֮͑ͯ΄͍͜͠ͱ ελΠϧͱCSSͷΑ͏ͳͷͰ͋Δ ఆٛͷॴͰద༻ൣғ͕ܾ·Δ x:Key͕͔͔͘ͳ͍͔Ͱશવҧ͏ ελΠϧʹλʔήοτ͕ඞਢʂ
ελΠϧͱ ͍͔ͭ͘ͷϓϩύςΟΛ·ͱΊͨͷ ݸผʹɺશମʹɺෳͷཁૉʹద༻͢ ΔͨΊͷศརͳํ๏ ͭ·ΓCSSతͳͷͰ͢
CSSͱࣅ͍ͯΔͱ͜Ζ ఆٛ͢ΔॴͰద༻ൣғ͕มΘΔ ผϑΝΠϧʢϦιʔεσΟΫγϣφϦʣ> Application > Window > Page > ύωϧʢGridͱ͔ʣ
> 1ͭͷ ίϯτϩʔϧ > Template ఆ͕͔ٛͿͬͨ߹࠷ޙʹએݴͨ͠΄͏͕উͭ ݟͨͱϩδοΫΛͰ͖Δ XAML͚ͩͰݟͨΛࣗ༝ʹม͑ΒΕΔ
StyleͰઃఆͰ͖Δͷ ϓϩύςΟ എܠ৭ͱ͔ɺઢͷଠ͞ͱ͔ TemplateϓϩύςΟʹControlTemplateΛηοτ͢Δ͜ͱͰ͖Δ طଘͷίϯτϩʔϧͷࢹ֮తߏɾಈ࡞Λ࠶ఆٛͰ͖Δຐվ ࣍ճѻ͍·͢ TriggerʢϓϩύςΟτϦΨʔʣ ͜ͷϓϩύςΟ͕͜ΕʹͳͬͨΒ͜ͷϓϩύςΟΛ͜ͷʹ͢Δ EventTrigger MouseEnterΠϕϯτ͕ൃੜͨ͠Β0.2ඵ͔͚ͯOpacityΛ0.8ʹ͢Δͱ͔
؆୯ͳྫ ඞͣTargetType͕ඞཁ C#͔ͩΒܕݫີͳͷͰ͢ <Page.Resources> <Style TargetType="Button"> <Setter Property="Background" Value="AliceBlue"/> <Setter
Property="FontSize" Value="14"/> </Style> </Page.Resources> <Grid> <UniformGrid> <Button Content="Button1"/> <Button Content="Button2"/> <Button Content="Button3"/> </UniformGrid> </Grid>
x:Keyଐੑॏཁʂ x:Keyଐੑ͕ແ͍ͱɺTargetTypeͰࢦఆͨ͠ܕશ෦ʹద༻ x:Keyଐੑ͕͋ΔͱɺͦͷΩʔΛࢦఆͨ͠ͷ͚͕ͩద ༻ <Page.Resources> <Style x:Key="BlueButtonStyle" TargetType="Button"> <Setter Property="Background"
Value="AliceBlue"/> <Setter Property="FontSize" Value="14"/> </Style> </Page.Resources> <Grid> <UniformGrid> <Button Content="Button1"/> <Button Content="Button2" Style="{StaticResource BlueButtonStyle}"/> <Button Content="Button3"/> </UniformGrid> </Grid>
BasedOnͰܧঝͰ͖·͢ ผͷελΠϧΛج ʹɺελΠϧͷՃ ͕Ͱ͖Δ <Page.Resources> <Style TargetType="Button"> <Setter Property="Background" Value="AliceBlue"/>
<Setter Property="FontSize" Value="14"/> </Style> <Style x:Key="AmazingButtonStyle" TargetType="Button" BasedOn="{StaticResource {x:Type Button}}"> <Setter Property="RenderTransform"> <Setter.Value> <RotateTransform Angle="10"/> </Setter.Value> </Setter> </Style> </Page.Resources> <Grid> <UniformGrid> <Button Content="Button1"/> <Button Content="Button2" Style="{StaticResource AmazingButtonStyle}"/> <Button Content="Button3"/> </UniformGrid> </Grid>
ελΠϧͱ࠶ར༻Λ తͱͨ͠ͷ XAMLϦιʔεͱ͍͏֓೦Ͱཧ ϦιʔεʹελΠϧʴϒϥγ ϦιʔεσΟΫγϣφϦͱ͍͏ผϑΝΠ ϧʹ͢ΔͱɺΞϓϦέʔγϣϯؒͰڞ ༗Ͱ͖Δ
ϒϥγϦιʔεʹ͠ͱ ͘ͱศར ͍ճ͕͠Ͱ͖ΔͷͰɺޙͰશମͷ৭ຯΛม ͍͑͢ Πϯελϯε͕1ݸͰࡁΉ <Page.Resources> <SolidColorBrush x:Key="ButtonBackColor" Color="AliceBlue"/> <Style
TargetType="{x:Type Button}"> <Setter Property="Background" Value="{StaticResource ButtonBackColor}"/> <Setter Property="FontSize" Value="14"/> </Style> </Page.Resources>
͔͠͠ͳΜ͔ͩΜͩݴͬ ͯ…… ελΠϧͷϝΠϯContentTemplate ࣍ճ͕ΜΓ·͠ΐ͏ʂ