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
hachiilcane
March 01, 2022
Programming
140
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
WPF勉強会 第4回 スタイルの初歩/WPFStudy4
WPF勉強会 第4回 スタイルの初歩
説明後に実演するライブコーディングのコードはこちら。
https://github.com/hachiilcane/WpfStudy
hachiilcane
March 01, 2022
More Decks by hachiilcane
See All by hachiilcane
機械学習勉強会01 1次関数での回帰分析/MLStudy01
hachiilcane
0
66
機械学習勉強会02 多項式近似と最小二乗法による推定/MLStudy02
hachiilcane
0
100
機械学習勉強会03 最急降下法/MLStudy03
hachiilcane
0
40
機械学習勉強会04 偏微分と連鎖律/MLStudy04
hachiilcane
0
44
機械学習勉強会05 パーセプトロン/MLStudy05
hachiilcane
0
45
機械学習勉強会06 ロジスティック回帰/MLStudy06
hachiilcane
0
59
機械学習勉強会07 ROC曲線/MLStudy07
hachiilcane
0
44
機械学習勉強会08 2次元入力3クラス分類/MLStudy08
hachiilcane
0
74
機械学習勉強会09 2層フィードフォワードニューラルネット/MLStudy09
hachiilcane
0
72
Other Decks in Programming
See All in Programming
170k Jobs a Day on GKE: Scaling Mercari's CI Platform - and What's Next for AI-Native Development
junyaokabe
0
110
片田舎のおっさん、 Swift Buildのダイアモンド問題解決の不具合修正PRを出すが、解決方法がキャッシュをしないようにすることであり、ビルド時間が伸びると言われてマージされないので高速化もする/swiftbuild
yimajo
0
150
in-process GraphQL のすすめ #ginzajs
izumin5210
4
1.4k
ドリフトを絶対に許さない(?)CDK運用 / CDK Ops with Zero Tolerance for Drifts (?)
akihisaikeda
1
210
Detecting Compromised CI with eBPF and Cilium Tetragon
lizrice
0
210
AI Engineeringは、AIプロダクトだけのものか? 〜AIがソフトウェアを作る時代の新しい当たり前〜 / No AI in your product. AI Engineering in your development.
rkaga
4
480
仕様書を書く前にハーネスを作る - Agent Native開発は「探索を速く、判定を固く」
gotalab555
4
1.7k
AI時代に設計が 最大の生産性レバーになる 意図駆動開発とデータを消さない設計|Don't Delete Your Data or Your Intent — Design as the Deepest Lever in the AI Era
tomohisa
1
1.1k
バグを直したら useEffect が消えた
colorful12
3
650
実装をデザインガイドラインに追従させるための取り組み / 260731-dip-mosh-design-system
dachi023
0
5.7k
yield再入門 #phpcon
o0h
PRO
0
1.2k
torikago - Ruby::Boxで照らすモジュラモノリスの実行境界
se4weed
1
390
Featured
See All Featured
The #1 spot is gone: here's how to win anyway
tamaranovitovic
3
1.1k
Bash Introduction
62gerente
615
220k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.4k
Making the Leap to Tech Lead
cromwellryan
135
10k
Tell your own story through comics
letsgokoyo
1
1k
Deep Space Network (abreviated)
tonyrice
0
260
The Cost Of JavaScript in 2023
addyosmani
55
10k
Ethics towards AI in product and experience design
skipperchong
2
350
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
480
RailsConf 2023
tenderlove
30
1.5k
Fireside Chat
paigeccino
42
4k
What does AI have to do with Human Rights?
axbom
PRO
1
2.3k
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 ࣍ճ͕ΜΓ·͠ΐ͏ʂ