Search Results

Search found 9 results on 1 pages for 'gehho'.

Page 1/1 | 1 

  • Hide ticks at Min and Max in WPF Slider

    - by gehho
    Hi, I want to display a Slider ranging from 0.5 to 1.5 with only one tick mark at 1.0 to mark the center and default value. I have defined a Slider as follows: <Slider Minimum="0.5" Maximum="1.5" IsMoveToPointEnabled="True" IsSnapToTickEnabled="False" Orientation="Horizontal" Ticks="1.0" TickPlacement="BottomRight" Value="{Binding SomeProperty, Mode=TwoWay}"/> However, besides a tick mark at 0.0 this Slider also shows tick marks at 0.5 and 1.5, i.e. the Minimum and Maximum values. Is there a way to hide these min/max tick marks?! I checked all properties and tried changing some of them, but did not have success so far. Thanks, gehho.

    Read the article

  • How to implement Master-Detail with Multi-Selection in WPF?

    - by gehho
    Hi, I plan to create a typical Master-Detail scenario, i.e. a collection of items displayed in a ListView via DataBinding to an ICollectionView, and details about the selected item in a separate group of controls (TextBoxes, NumUpDowns...). No problem so far, actually I have already implemented a pretty similar scenario in an older project. However, it should be possible to select multiple items in the ListView and get the appropriate shared values displayed in the detail view. This means, if all selected items have the same value for a property, this value should be displayed in the detail view. If they do not share the same value, the corresponding control should provide some visual clue for the user indicating this, and no value should be displayed (or an "undefined" state in a CheckBox for example). Now, if the user edits the value, this change should be applied to all selected items. Further requirements are: MVVM compatibility (i.e. not too much code-behind) Extendability (new properties/types can be added later on) Does anyone have experience with such a scenario? Actually, I think this should be a very common scenario. However, I could not find any details on that topic anywhere. Thanks! gehho. PS: In the older project mentioned above, I had a solution using a subclass of the ViewModel which handles the special case of multi-selection. It checked all selected items for equality and returned the appropriate values. However, this approach had some drawbacks and somehow seemed like a hack because (besides other smelly things) it was necessary to break the synchronization between the ListView and the detail view and handle it manually.

    Read the article

  • Default custom ControlTemplate is not applied when using Style

    - by gehho
    Hi all, I have created a default style for a Button including a custom ControlTemplate like so: <Style TargetType="{x:Type Button}"> <Setter Property="OverridesDefaultStyle" Value="True"/> <Setter Property="Background" Value="White"/> <Setter Property="BorderBrush" Value="Black"/> <!-- ...other property setters... --> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type Button}"> <Grid x:Name="gridMain"> <!-- some content here --> </Grid> </ControlTemplate> </Setter.Value> </Setter> </Style> This style is added to my shared ResourceDictionary which is loaded by every control. Now, this style/template is applied to all my buttons, as expected, but it is NOT applied to those buttons which locally use a different style. For example, I want to have a certain margin for my "OK", "Apply" and "Cancel" buttons. Therefore, I defined the following style: <Style x:Key="OKApplyCancelStyle" TargetType="{x:Type Button}"> <Setter Property="Margin" Value="4,8"/> <Setter Property="Padding" Value="8,6"/> <Setter Property="MinWidth" Value="100"/> <Setter Property="FontSize" Value="16"/> </Style> ...and applied that style to my buttons using a StaticResource: <Button Content="OK" Style="{StaticResource OKApplyCancelStyle}"/> For me, the expected result would be that the ControlTemplate above would still be applied, using the values for Margin, Padding, MinWidth and FontSize from the "OKApplyCancelStyle". But this is not the case. The default Windows ControlTemplate is used instead, using the values from the style. Is this the typical behavior? Does a local style really override a custom ControlTemplate? If so, how can I achieve my desired behavior? I.e. still use my custom ControlTemplate even when styles are defined locally? Many thanks in advance, gehho.

    Read the article

  • Process.CloseMainWindow() not working

    - by gehho
    I start the Windows On-Screen-Keyboard like that: s_onScreenKeyboard = new Process(); s_onScreenKeyboard.StartInfo = new ProcessStartInfo("osk.exe"); s_onScreenKeyboard.EnableRaisingEvents = true; s_onScreenKeyboard.Exited += new EventHandler(s_onScreenKeyboard_Exited); s_onScreenKeyboard.Start(); This works fine, but when I try to stop it using the following code, it does nothing: s_onScreenKeyboard.CloseMainWindow(); if (!s_onScreenKeyboard.HasExited) { if (!s_onScreenKeyboard.WaitForExit(1000)) { s_onScreenKeyboard.Close(); //s_onScreenKeyboard.Kill(); } } When uncommenting s_onScreenKeyboard.Kill(); it is closed, but the problem is that osk.exe obviously uses another process called "msswchx.exe" which is not closed if I simply kill the OSK process. This way, I would end up with hundreds of these processes which is not what I want. Another strange thing is that the CloseMainWindow() call worked at some time, but then it suddenly did not work anymore, and I do not remember what has changed. Any ideas? Background: I am implementing an On-Screen-Keyboard for my application because it should work with a touchscreen. It is important that the keyboard layout matches the layout which is configured in Windows since the application will be shipped to many different countries. Therefore, instead of implementing a custom keyboard control with approx. 537 keyboard layouts (exaggerating a little here...), I wanted to utilize the Windows built-in On-Screen-Keyboard which adapts to the selected keyboard layout automatically, saving a lot of work for me.

    Read the article

  • Is it possible to disable a ScrollViewer from inside the ScrollViewer?

    - by gehho
    From a UserControl, I would like to disable a ScrollViewer which is defined one level higher. My scenario looks something like this: <!-- ... --> <ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled"> <custom:MyUserControl ... /> </ScrollViewer> Now, I would like to disable the ScrollViewer from within MyUserControl. Is this possible? Background: I have defined a custom TabControl style where I added a ScrollViewer for each item's content automatically. However, in one case, I do not want to use that ScrollViewer, but rather make the content size to the available space, whereas in all other cases I do want to use the ScrollViewer. Any ideas? Of course, I could add a ScrollViewer to every tab item manually, except for the one item, but that is not what I want.

    Read the article

  • Localization: How to allow the user to define custom resources without compiling?

    - by gehho
    In our application, we have a collection of data items, each with a DisplayedName property. This property should be localized, i.e. it should be displayed in the language selected by the user. Therefore, another property, DisplayedNameResourceKey, specifies which resource should be returned by the DisplayedName property. In simplified code this means something like this: public string DisplayedName { get { return MyResources.ResourceManager.GetObject(this.DisplayedNameResourceKey); } } public string DisplayedNameResourceKey { get; set; } Now, the problem is: The user should be able to edit these items including the DisplayedName, or more precisely the DisplayedNameResourceKey. And not only this, but the user should also be able to somehow define new resources which he can then reference. That is, he can either choose from a predefined set of resources (some commonly used names), or define a custom resource which then needs to be localized by the user as well. However, the user cannot add custom resources to MyResources at runtime and without compiling. Therefore, another approach is needed. It does not have to be an extremely user-friendly way (e.g. UI is not required) because this will typically be done by our service engineers. I was thinking about using a txt or csv file containing pairs of resource keys and the corresponding translations. A separate file would exist for every language at a predefined location. But I am not really satisfied with that idea because it involves a lot of work to resolve the resources. Does anyone know a good approach for such a situation?

    Read the article

  • Detailed change history of .NET framework versions?

    - by gehho
    I am looking for a detailed change history (including bugfixes) of all .NET framework versions, especially the changes between 2.0 and 3.5 SP1. I know that something like that exists for v2.0 and v1.1, and for v4.0. However, I could not find a history for v3.0 and v3.5/SP1. Background: (slightly edited) We are having issues somewhere between deserialization of some XML data (using XmlReader) and the display of the data in the UI. These problems appear when we use .NET 3.5 SP1, but we did not have them in v2.0. Now, I would like to know if this is related to some change/bugfix in the framework, or if this is related to some other difference. Unfortunately, we do not have the source code of that piece of software, and most of the software is written using native C++/MFC, except for the deserialization part which is .NET.

    Read the article

  • Diff/Merge functionality for objects (not files!)

    - by gehho
    I have a collection of objects of the same type, let's call it DataItem. The user can view and edit these items in an editor. It should also be possible to compare and merge different items, i.e. some sort of diff/merge for DataItem instances. The DIFF functionality should compare all (relevant) properties/fields of the items and detect possible differences. The MERGE functionality should then be able to merge two instances by applying selected differences to one of the items. For example (pseudo objects): DataItem1 { DataItem2 { Prop1 = 10 Prop1 = 10 Prop2 = 25 Prop2 = 13 Prop3 = 0 Prop3 = 5 Coll = { 7, 4, 8 } Coll = { 7, 4, 8, 12 } } } Now, the user should be provided with a list of differences (i.e. Prop2, Prop3, and Coll) and he should be able to select which differences he wants to eliminate by assigning the value from one item to the other. He should also be able to choose if he wants to assign the value from DataItem1 to DataItem2 or vice versa. Are there common practices which should be used to implement this functionality? Since the same editor should also provide undo/redo functionality (using the Command pattern), I was thinking about reusing the ICommand implementations because both scenarios basically handle with property assignments, collection changes, and so on... My idea was to create Difference objects with ICommand properties which can be used to perform a merge operation for this specific Difference. Btw: The programming language will be C# with .NET 3.5SP1/4.0. However, I think this is more of a language-independent question. Any design pattern/idea/whatsoever is welcome!

    Read the article

  • Unity: Replace registered type with another type at runtime

    - by gehho
    We have a scenario where the user can choose between different hardware at runtime. In the background we have several different hardware classes which all implement an IHardware interface. We would like to use Unity to register the currently selected hardware instance for this interface. However, when the user selects another hardware, this would require us to replace this registration at runtime. The following example might make this clearer: public interface IHardware { // some methods... } public class HardwareA : IHardware { // ... } public class HardwareB : IHardware { // ... } container.RegisterInstance<IHardware>(new HardwareA()); // user selects new hardware somewhere in the configuration... // the following is invalid code, but can it be achieved another way? container.ReplaceInstance<IHardware>(new HardwareB()); Can this behavior be achieved somehow? BTW: I am completely aware that instances which have already been resolved from the container will not be replaced with the new instances, of course. We would take care of that ourselves by forcing them to resolve the instance once again.

    Read the article

1