Overlap detection for laying out elements on a page

How would you simplify/improve the readability of this code? Because even after my attempt to improve the readability I think it still looks messy. private bool INTOP = false; private bool INLEFT = false; private bool INRIGHT = false; private bool INBOTTOM = false; private bool BEYOND = false; private List<DependencyObject> BEYONDDO = new List<DependencyObject>(); … Read more

How can I make a TextBox be a “password box” and display stars when using MVVM?

How can I do this in XAML: PSEUDO-CODE: <TextBox Text=”{Binding Password}” Type=”Password”/> so that the user sees stars or dots when he is typing in the password. I’ve tried various examples which suggest PasswordChar and PasswordBox but can’t get these to work. e.g. I can do this as shown here: <PasswordBox Grid.Column=”1″ Grid.Row=”1″ PasswordChar=”*”/> but … Read more

Binding only part of the margin property of WPF control

I have this: <TabControl Margin=”0,24,0,0″>…</TabControl> I want to bind only the “Top” part of the TabControl, which intuitively I would do it this way: <TabControl Margin=”0,{Binding ElementName=TheMenu, Path=Height},0,0″> … </TabControl> How do I do it ? Answer Have you tried using a converter like this? in VB.Net Public Class MarginConverter Implements IValueConverter Public Function Convert(ByVal … Read more

WPF Popup UI showing black

I am using a WPF Popup control, and it is showing the background as black. I put a StackPanel inside it with Background=”Transparent”, but that does not help. <Popup PlacementTarget=”{Binding ElementName=parentStackPanel}” Placement=”Center” IsOpen=”False” Name=”m_popWaitNotifier” PopupAnimation=”None” AllowsTransparency=”False”> <StackPanel Orientation=”Vertical” Background=”Transparent”> <uc:CircularProgressBar x:Name=”CB” StartupDelay=”0″ RotationsPerMinute=”20″ Height=”25″ Foreground=”White” Margin=”12″/> </StackPanel> </Popup> How does one make the background on … Read more