-
-
Save aaronc/fab70684cb52803a983f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Load my-view1.clj and enter at the REPL: | |
my-view1=> (dev-init #'init-my-view1) | |
You should see a Window appear with a button. | |
Pressing F5 will cause the view to reload (including reloading the XAML from the disk). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns my-view1 | |
(:use | |
[ClojureWpf.core]) | |
(:import | |
[System.Windows MessageBox])) | |
(defn- on-hello-click [s e] | |
(MessageBox/Show "You clicked hello")) | |
(defn init-my-view1 [] | |
(let [view (load-dev-xaml "MyView1.xaml")] | |
(at [view :btnHello] :Click #'on-hello-click) | |
view)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<UserControl x:Class="MyView1" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
Height="650" Width="575"> | |
<Grid> | |
<Button x:Name="btnHello">Hello World</Button> | |
</Grid> | |
</UserControl> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment