Search Results

Search found 5961 results on 239 pages for 'wpf 4 5'.

Page 90/239 | < Previous Page | 86 87 88 89 90 91 92 93 94 95 96 97  | Next Page >

  • WPF inherited UserControl lost VS designer support

    - by PaN1C_Showt1Me
    Hi ! I' written this UserControl: <my:MyUserControl x:Class="MyClass" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:my="clr-namespace:MyNameSpace.MyControls;assembly=MyAssembly"> </my:MyUserControl> public partial class Editor : MyNameSpace.MyControls.MyUserControl {} Everything works, the control is shown in the VS 2008 Designer, but I cannot click directly in the elements and select them as it was with UserControl. Any idea how to solve it?

    Read the article

  • WPF, databinding

    - by fsl
    Hi there In a given binding is it possible to specify the path on the source object? Seems like this could a void a lot of trivial converters.. Imagine this..: class foo { bool A int B } <ComboBox ItemsSource="ListOfFoos" SelectedItem="{Binding number, SourcePath=B}" />

    Read the article

  • WPF format displayed text?

    - by Mark
    I have a column defined like this: <DataGridTextColumn Binding="{Binding Path=FileSizeBytes, Mode=OneWay}" Header="Size" IsReadOnly="True" /> But instead of displaying the file size as a big number, I'd like to display units, but still have it sort by the actual FileSizeBytes. Is there some way I can run it through a function or something before displaying it?

    Read the article

  • WPF: Trying to add a class to Window.Resources Again

    - by user3952846
    I did exactly the same thing, but still the same error is occurring: "The tag 'CenterToolTipConverter' does not exist in XML namespace 'clr-namespace:WpfApplication1;assembly=WpfApplication1'. Line 12 Position 10." CenterToolTipConverter.cs namespace WpfApplication1 { public class CenterToolTipConverter : IMultiValueConverter { public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) { if (values.FirstOrDefault(v => v == DependencyProperty.UnsetValue) != null) { return double.NaN; } double placementTargetWidth = (double)values[0]; double toolTipWidth = (double)values[1]; return (placementTargetWidth / 2.0) - (toolTipWidth / 2.0); } public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) { throw new NotSupportedException(); } } } MainWindow.xaml <Window x:Class="WpfApplication1.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:WpfApplication1;assembly=WpfApplication1" Title="MainWindow" Height="350" Width="525"> <Window.Resources> <local:CenterToolTipConverter x:Key="myCenterToolTipConverter"/> </Window.Resources> </Window> What am I doing wrong? Thanks in advance!!!

    Read the article

  • WPF options classic theme

    - by ProgrammerAtWork
    I have the following resources XML in my grid: <Grid.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="/PresentationFramework.Classic;component/themes/classic.xaml" /> </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </Grid.Resources> And this works, I load in the classic theme. But the classic theme button backgrounds are very white? Is there any way I can change the default background color of buttons in this theme?

    Read the article

  • Binding a single array cell to a WPF control

    - by yomi
    Hi, I have a bool array of size 4 and I want to bind each cell to a different control. This bool array represents 4 statuses (false = failure, true = success). This bool array is a propery with a class: class foo : INotifyPropertyChanged { ... private bool[] _Statuses; public bool[] Statuses { get {return Statuses;} set { Statuses = value; OnPropertyChanged("Statuses"); } } In XAML there are 4 controls, each one bound to one cell of the array: ... Text="{Binding Path=Statuses[0]}" ... ... Text="{Binding Path=Statuses[1]}" ... ... Text="{Binding Path=Statuses[2]}" ... ... Text="{Binding Path=Statuses[3]}" ... The problem is that the notify event is raised only when I change the array itself and isn't raised when I change one value within the array, i.e, next code line raises the event: Statuses = new bool[4]; but next line does not raises the event: Statuses [0] = true; How can I raise the event each time one cell is changed?

    Read the article

  • WPF binding: Doing a temperature converter app

    - by Bob
    Hi there, I'm doing a little app that basically has 2 text boxes. You'll enter Fahrenheit into TextBoxA and Celsius into TextBoxB. As the text changes in TextBoxA I want the equivalent Celsius value to be displayed in TextBoxB and vice versa. I can come up with a solution pretty easy for this but i'm trying to be a little clever. Is there a way to do it all in Xaml except for a Convert class that does the maths? So basically I want the TextChanged event of one textBox to pass in it's value into a Converter class that is evaluated and sent to the other TextBox and visa versa. Anyone know how I can achieve this ... and if it's possible at all?

    Read the article

  • WPF/Silverlight DataBinding to interface property (with hidden implementation)

    - by Dave
    I have the following (C#) code namespace A { interface IX { bool Prop { get; set; } } class X : IX { public bool Prop { ... } } // hidden implementation of IX } namespace B { .. A.IX x = ...; object.DataContext = x; object.SetBinding(SomeDependencyProperty, new Binding("Prop")); .. } So I have a hidden implementation of an interface with a property "Prop" and I need to bind to this property in code. My problem is that the binding isn't working unless I make class X public. Is there any way around this problem?

    Read the article

  • WPF bind IsEnabled on other controls if a listbox has a select item

    - by the empirical programmer
    I have a grid with 2 columns, a listbox in column 0 and a number of other controls in the a secondary grid in the main grids column 1. I want this controls only to be enabled (or perhaps visible) if an items is selected in the listbox through binding. I tried on a combo box: IsEnabled="{Binding myList.SelectedIndex}" But that does not seem to work. Am I missing something? Should something like this work? thanks

    Read the article

  • C# WPF Unable to control Textboxes

    - by Bo0m3r
    I'm a beginner in coding into C#. While I'm launching a process I can't controls my textboxes. I found some answers on this forum but the explaination is a bit to difficult for me to implement it for my problem. I created a small program that will run a batch file to make a backup. While the backup is running I can't modify my textboxes, disabling buttons etc... I already saw that this is normal but I don't know how to implement the solutions. My last attempt was with Dispatcher.invoke as you can see below. public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); tb_Status.Text = "Ready"; } public void status() { Dispatcher.Invoke(DispatcherPriority.Send, new Action( () => { tb_Status.Text = "The backup is running!"; } ) ); } public void process() { try { Process p = new Process(); p.StartInfo.WindowStyle = ProcessWindowStyle.Minimized; p.StartInfo.CreateNoWindow = true; p.StartInfo.UseShellExecute = false; p.StartInfo.RedirectStandardOutput = true; p.StartInfo.FileName = "Robocopy.bat"; p.Start(); string output = p.StandardOutput.ReadToEnd(); p.WaitForExit(); tb_Output.Text = File.ReadAllText("Backup\\log.txt"); } catch (Exception ex) { tb_Status.Text = ex.Message.ToString(); } } private void Bt_Start_Click(object sender, EventArgs e) { status(); Directory.CreateDirectory("Backup"); process(); tb_Status.Text = "The backup finished"; File.Delete("Backup\\log.txt"); } } } Any help is appreciated!

    Read the article

  • WPF MessageBox close without any action

    - by developer
    Hi, I have a confirmation message box for the user in one of my apps. Below is the code for that, MessageBoxResult res= System.Windows.MessageBox.Show("Could not find the folder, so the D: Drive will be opened instead."); if (res == MessageBoxResult.OK) { MessageBox.Show("OK"); } else { MessageBox.Show("Do Nothing"); } Now, when the user clicks on the OK button, I want certain code to execute but when they click on the red cross at the upper right corner, I just want the messagebox to close without doing anything. In my case I get 'OK' displayed even when I click on the red cross icon at the upper right corner. Is there a way I can have 'Do Nothing' displayed when I click on the cross. I not want to add any more buttons.

    Read the article

  • WPF - hiding listbox items

    - by user553765
    Hi, I have a listbox where the itemtemplate is using a style. The styles specifies a border with a datatrigger setting the visibility of the border to collapsed depending on a property. This works fine except I can still see a very narrow line for each item, in the list, that is collapsed. I was hoping someone could help with how to set the visibility so that there are no visible traces as this is quite apparent when consecutive items have been collapsed. The datatemplate specifies an outer border with a dockpanel inside of this - there are then stackpanels docked to this. Any help is appreciated.

    Read the article

  • WPF: Implementation of ApplicationCommands.Copy?

    - by Ikhail
    I just created a menu with Command="ApplicationCommands.Copy" and I thought I had to handle the Executed event of the binding, and add a binding but I just don't need to. Now I'm confused! Where is the implementation of this command? How can it automatically copy a text selected in any of the textboxes I have in my window? thanks!

    Read the article

  • [WPF] When Should I Retrieve Values from Textbox?

    - by they_soft
    Suppose I have a Window with TextBoxes I want to use the values. Right now I'm thinking of either: 1) Updating each associated value once the cursor is out of focus, and once the user presses Ok I start the program 2) Once the user presses Ok, I retrieve all the values at once then start the program I'm not sure which one is better though. First alternative seems more modular, but there's more semantic coupling since I each new box is supposed to be updating its respective value. I realize this isn't all that important, but I'm trying to understand when to centralize and when not to. Other better approachers are appreciated too.

    Read the article

  • DisplayMemberPath is not working in WPF

    - by WpfBee
    I want to display CustomerList\CustomerName property items to the listBox using ItemsSource DisplayMemberPath property only. But it is not working. I do not want to use DataContext or any other binding in my problem. Please help. My code is given below: MainWindow.xaml.cs namespace BindingAnItemControlToAList { /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); } } public class Customer { public string Name {get;set;} public string LastName { get; set; } } public class CustomerList { public List<Customer> Customers { get; set; } public List<string> CustomerName { get; set; } public List<string> CustomerLastName { get; set; } public CustomerList() { Customers = new List<Customer>(); CustomerName = new List<string>(); CustomerLastName = new List<string>(); CustomerName.Add("Name1"); CustomerLastName.Add("LastName1"); CustomerName.Add("Name2"); CustomerLastName.Add("LastName2"); Customers.Add(new Customer() { Name = CustomerName[0], LastName = CustomerLastName[0] }); Customers.Add(new Customer() { Name = CustomerName[1], LastName = CustomerLastName[1] }); } } } **MainWindow.Xaml** <Window x:Class="BindingAnItemControlToAList.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:BindingAnItemControlToAList" Title="MainWindow" Height="350" Width="525" Loaded="Window_Loaded" > <Window.Resources> <local:CustomerList x:Key="Cust"/> </Window.Resources> <Grid Name="Grid1"> <ListBox ItemsSource="{Binding Source={StaticResource Cust}}" DisplayMemberPath="CustomerName" Height="172" HorizontalAlignment="Left" Margin="27,23,0,0" Name="lstStates" VerticalAlignment="Top" Width="245" /> </Grid> </Window>

    Read the article

  • Moving an item up and down in a WPF list box

    - by DommyCastles
    I have a list box with a bunch of values in it. I also have an UP button and a DOWN button. With these buttons, I would like to move the selected item in the list box up/down. I am having trouble doing this. Here is my code so far: private void btnDataUp_Click(object sender, RoutedEventArgs e) { int selectedIndex = listBoxDatasetValues.SelectedIndex; //get the selected item in the data list if (selectedIndex != -1 && selectedIndex != 0) //if the selected item is selected and not at the top of the list { //swap items here listBoxDatasetValues.SelectedIndex = selectedIndex - 1; //keep the item selected } } I do not know how to swap the values! Any help would be GREATLY appreciated!

    Read the article

  • Welcome 2011

    - by PSteele
    About this time last year, I wrote a blog post about how January of 2010 was almost over and I hadn’t done a single blog post.  Ugh…  History repeats itself. 2010 in Review If I look back at 2010, it was a great year in terms of technology and development: Visited Redmond to attend the MVP Summit in February.  Had a great time with the MS product teams and got to connect with some really smart people. Continued my work on Visual Studio Magazine’s “C# Corner” column.  About mid-year, the column changed from an every-other-month print column to an every-other-month print column along with bi-monthly web-only articles.  Needless to say, this kept me even busier and away from my blog. Participated in another GiveCamp!  Thanks to the wonderful leadership of Michael Eaton and all of his minions, GiveCamp 2010 was another great success.  Planning for GiveCamp 2011 will be starting soon… I switched to DVCS full time.  After years of being a loyal SVN user, I got bit by the DVCS bug.  I played around with both Mercurial and Git and finally settled on Mercurial.  It’s seamless integration with Windows Explorer along with it’s wealth of plugins made me fall in love.  I can’t imagine going back and using a centralized version control system. Continued to work with the awesome group of talent at SRT Solutions.  Very proud that SRT won it’s third consecutive FastTrack award! Jumped off the BlackBerry train and enjoying the smooth ride of Android.  It was time to replace the old BlackBerry Storm so I did some research and settled on the Motorola DroidX.  I couldn’t be happier.  Android is a slick OS and the DroidX is a sweet piece of hardware.  Been dabbling in some Android development with both Eclipse and IntelliJ IDEA (I like IntelliJ IDEA a lot better!).   2011 Plans On January 1st I was pleasantly surprised to get an email from the Microsoft MVP program letting me know that I had received the MVP award again for my community work in 2010.  I’m honored and humbled to be recognized by Microsoft as well as my peers! I’ll continue to do some Android development.  I’m currently working on a simple app to get me feet wet.  It may even makes it’s way into the Android Market. I’ve got a project that could really benefit from WPF so I’ll be diving into WPF this year.  I’ve played around with WPF a bit in the past – simple demos and learning exercises – but this will give me a chance to build an entire application in WPF.  I’m looking forward to the increased freedom that a WPF UI should give me. I plan on blogging a lot more in 2011! Technorati Tags: Android,MVP,Mercurial,WPF,SRT,GiveCamp

    Read the article

  • Reasonable technological solutions to create CRM using .NET eventually Java

    - by user1825608
    My background(If it's too long, just skip it please ; ) ): I am Java programmer(because of demand): mostly teacher for other students, worked on few thesis for others, but during my journey I discovered that .NET and Microsoft's tools are on at least two levels higher than Java and its tools so I want to learn more about them. I programmed little bit on Windows Phone(NFC Tags, TCP Clients, guitar tuner using internal microphone, simple RSS), used WPF, integrated WPF with Windows Forms, Apple Bonjour(.NET), I have expierience with IP cameras and with unusal problems, I learn Android, but I don't like it at all. Problem: I was asked by my friend to create CRM for small new company. There will maximum 20 workers in the company working at computers in few cities in the country(Poland). They just want to store contracts with the clients and client's data. I am not sure what exacly they do but probably sell apartments so there will be at most few thousands of contracts to store in far future. Now I am totally new to CRM but I want to learn. I have few questions: Should the data be stored on a server in the company's building running 24/7 or cloud. If cloud which one? Should I use ASPX or WPF. I read one topic about it but as far as I know aspx sites can be viewed from every device with internet browser: tablets, phones(Android, WP, iOS) and computers at the same time- so the job is done once and for all(Am I right?), I don't know nothing about aspx. Can WPF be also used in manner that does not need to port it for other platforms?

    Read the article

  • c#: what is the purpose of wpf vs. winforms [closed]

    - by every_answer_gets_a_point
    i know wpf can be richer-looking, but what is the point of using them if they complicate things so much? for example if i want to do something on form load in wpf i have to through the trouble of writing this: public MyWindow() { Loaded += MyWindow_Loaded; } private void MyWindow_Loaded(object sender, RoutedEventArgs e) { // do work here } whereas in winforms all i do is double click on the form the question is what are the benefits of using wpf over winforms?

    Read the article

  • Why do so many wpf controls implement CLR properties instead of dependency properties ?

    - by msfanboy
    Hello, is it because the controls programmers are lazy, too hard to implement or not knowledgeable? Wether they are custom controls from 3rd party vendors or Microsoft itself, very much controls have often clr properties instead of DP. Result is I can not bind to them and is wpf not all about binding? :/ My next side question would be, why do so many wpf controls offer visual parts but they are not member of the visual tree ? see wpf datagrid columns, headers... What do you think?

    Read the article

  • Advantage of WPF app vs Winform for business apps?

    - by Abdu
    I know asp.net and winform development. I am not the type of developer who jumps into a new technology just because it's new. It needs to give me extra benefits like higher productivity. What are the advantages of WPF over Winforms for pure business apps? I am not interested in the extra eye candy, animation, gradients, image display effects and so on which WPF provides. The business apps are for data entry, data reporting and maybe some charts and static display of photos. How will WPF help in these apps? Better richer data binding? WinForm is a mature proven technology and I like the fact I can do everything in Visual Studio vs multiple IDE's for WPF (VS & Blend family). Plus I think WPF doesn't have as rich data binding controls like their Winform counterparts (DataGridView..etc). AFAIK, Microsoft will still support Winforms for many years. Try to convince someone like me to switch.

    Read the article

< Previous Page | 86 87 88 89 90 91 92 93 94 95 96 97  | Next Page >