-
-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
73 additions
and
22 deletions.
There are no files selected for viewing
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
54 changes: 51 additions & 3 deletions
54
source/iNKORE.UI.WPF.Modern.Gallery/ControlPages/RichEditBoxPage.xaml.cs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,70 @@ | ||
using System.Windows.Controls; | ||
using System.Windows; | ||
using System.Windows.Controls; | ||
using iNKORE.UI.WPF.Modern.Controls.Helpers; | ||
using iNKORE.UI.WPF.Modern.Controls; | ||
using Page = iNKORE.UI.WPF.Modern.Controls.Page; | ||
|
||
|
||
namespace iNKORE.UI.WPF.Modern.Gallery.ControlPages | ||
{ | ||
public partial class RichEditBoxPage | ||
public partial class RichEditBoxPage : Page | ||
{ | ||
public RichEditBoxPage() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
private void Page_Loaded(object sender, RoutedEventArgs e) | ||
{ | ||
UpdateExampleCode(); | ||
} | ||
|
||
private void CheckBox_Click(object sender, RoutedEventArgs e) | ||
{ | ||
UpdateExampleCode(); | ||
} | ||
|
||
private void TextBox_TextChanged(object sender, TextChangedEventArgs e) | ||
{ | ||
UpdateExampleCode(); | ||
} | ||
|
||
private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) | ||
{ | ||
UpdateExampleCode(); | ||
} | ||
|
||
|
||
#region Example Code | ||
|
||
public void UpdateExampleCode() | ||
{ | ||
if (!this.IsLoaded) return; | ||
|
||
Example1.Xaml = Example1Xaml; | ||
Example2.Xaml = Example2Xaml; | ||
} | ||
|
||
#endregion | ||
public string Example1Xaml => $@" | ||
<RichTextBox x:Name=""richTextBox"" | ||
ui:ControlHelper.Header=""Control header"" | ||
ui:ControlHelper.PlaceholderText=""Placeholder text"" | ||
SpellCheck.IsEnabled=""True"" /> | ||
"; | ||
|
||
public string Example2Xaml => $@" | ||
<RichTextBox x:Name=""textBox"" | ||
ui:ControlHelper.Header=""{ControlHelper.GetHeader(textBox)}"" | ||
ui:PlaceholderText=""{ControlHelper.GetPlaceholderText(textBox)}"" | ||
AcceptsReturn=""{textBox.AcceptsReturn}"" IsUndoEnabled=""{textBox.IsUndoEnabled}"" | ||
IsReadOnly=""{textBox.IsReadOnly}"" IsReadOnlyCaretVisible=""{textBox.IsReadOnlyCaretVisible}"" | ||
IsInactiveSelectionHighlightEnabled=""{textBox.IsInactiveSelectionHighlightEnabled}"" | ||
HorizontalScrollBarVisibility=""{textBox.HorizontalScrollBarVisibility}"" | ||
VerticalScrollBarVisibility=""{textBox.VerticalScrollBarVisibility}"" | ||
SelectionOpacity=""{textBox.SelectionOpacity}"" SpellCheck.IsEnabled=""{textBox.SpellCheck.IsEnabled}"" /> | ||
"; | ||
|
||
|
||
#endregion | ||
} | ||
} |