wpf

Compiling an IronPython WPF project to exe

What is the best way to pack up an IronPython application for deployment? After scouring the web the best thing I've come up with (and what I'm currently doing) is using clr.CompileModules() to glue together my entire project's .py files into one .dll, and then having a single run.py do this to run the dll: import clr clr.AddReference(...

Adding x:Name to a user control gives error in generated code of page its used in.

I am basically using a user control for the first time, so hopefully it's just a dumb mistake. I have a simple user control <UserControl x:Class="TestProject.WebApp.myUserControl" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas....

Is there a way to hide a specific column in a DataGrid when AutoGenerateColumns=True?

I have a WPF 4.0 DataGrid that is bound to a DataTable using AutoGenerateColumns=True. The columns are dynamic, however I know there is always going to be a column named ID and I would like to hide this column. Is there a way I can do this? ...

IsDropDown on IsMouseOver of ComboBox is killed by ONE mouseclick on WPF ComboBox WHEN it opens

This is the Style set to my ComboBox. When I hover the ComboBox, the popup opens/slides and then right at the moment where it opens I click on it which is closing the combobox because I have choosed an item. The next time I hover the combobox is does not open anymore... Why? <Style x:Key="GroupViewModelStyle"> <Style.Trigg...

How can I add bold text and AccessText to a Label or TextBlock?

I have a WPF conundrum. I want some text to look like this: Enter this preparer's info: [ComboBox] Alt+E is the access key that focuses the ComboBox, and when Alt is pressed, the E in the text should be underlined. I can get the access key to work easily: <Label Target="{Binding ElementName=PreparerComboBox}"> _Enter this p...

C# POS.NET PrintNormal() Issue 'It is not Initialized'

Hey Now Everybody- Current C# POS.NET Issue: PrintNormal() Throws Exception = 'It is not initialized' CheckHealth = 'It is not initialized' 'It is not initialized' exception when Printing to Epson TM-T88IV Using POS for .NET 1.12 and the Epson OPOS ADK for .NET (v1.11.9) service-objects Successfully able to Open, Claim...

Preloading a Page before Navigating to it WPF

My WPF app consists of a NavigationWindow, and then a set of Pages defined as separate xaml files. The NavigationWindow loads and displays the various pages in turn. My problem is that loading the pages is expensive and may fail. Thus, I want to preload the page in the background, and then only call Navigate() once the page has finish...

Rich formatting of text in a TextBlock using only DataBinding in XAML

I am trying to format a Tweet using Data Binding. What I need to do is split the Text value of the tweet based on what type of content it is. text = "This is a Tweet with a hyperlink http://www.mysite.com" I need to add some color formatting to the http://... portion of the text value. Here's the kicker, I'd like to do this using o...

two itemtemplates for one listbox

Hello everyone, I've got the problem with displaying wpf listbox items. I give abstract example. I hope it's going to be ok. I've got a class FruitViewModel - it describes viewmodels for listboxitems. And I've got class BananaViewModel : FruitViewModel and class AppleViewModel : FruitViewModel So, collection Fruits contains Bana...

C# WPF WebBrowser alternative

hi, I need a web browser inside my .NET 3.5 application and I don't want to use the default webbrowser (because it feels buggy and slow). I tried Chris Cavanagh's chromium but I just couldn't get it to work... are there any easier to use alternatives? I'm looking for something very simple and light on the computer, it will host a webstor...

c# - how to construct image from content of htmltext box.

I have a html text box control in which I have embedded certain text and image. I would like to construct an image for the entire control with its content (eg - text, image). Edit: This is a wpf application.Actually on higher level , I am trying to construct a customizned printpreview page. For printPreview , I construct a Flowdocument....

Why ComboBox be dropdown result whole app performance to very slow?

I have a wpf application.There is a strange thing that as long as i mousedown the ComboBox droparrow becomes all UI response very slow, regardless of whether ComboBox have items. Annoying the case only appears on some computers. Look forward to answering. ...

My databindings are not evaluated before the control loads, i get the property changed events after control is loaded why????

Hi, I have a very interesting issue and i have been breaking my head on it since a long time. I am new to WPF and related things like MVVM and all. I have a window in which i place a user control which hosts a TabControl inside it. This tab control has Custom Radio Button and Combo boxes which expose few Dependency Properties, Now wh...

Setting Font of TextBox from code behind

This maybe a stupid question but how do I set the font of a TextBox from a string in the code behind? // example txtEditor.FontFamily = "Consolas"; ...

Replacing XmlSerializer due to slow WPF application start-up

I have wrote a WPF application that reads a list of movies from a XML file at a network location. When I started investigating the slow start-up it turned out that XmlSerializer has a lot overhead. I have now used sgen to build the assemblies before I publish the project but I am now looking into a better solution. I have looked at the ...

Multibinding converter???

I am tryng to write a multibinding converter for a navigation model where I load pages into a frame when any listboxitem is selected from two listboxes. At the same time, I need to be able to navigate with Back/Forward buttons from the navigation class and being able to show listboxitem in selected state if its UriSource is loaded into t...

In C# and WPF, can you bind an element of an array to an objects property?

For example, is it possible to bind a Textblock's Text property to an element Name[2] of type String? ...

Choosing between bound ViewModel properties or messaging to communicate between ViewModel and View using the MVVM Light Toolkit

I'm using MVVM Light toolkit (which I love). I currently have messaging in place for some interaction originating from the ViewModel and intended for consumption by the View. Typically these types of messages indicate the View should do something like hide itself, show a confirmation message that data was saved, etc. This works. In t...

Drag and Drop In WPF C#

following is my code for drag and drop in wpf. i used the same code in windowform for drag and drop images but i does not seem to work for wpf Can you help ? <Image Height="464" Name="PictureBox" Stretch="Uniform" Width="769" AllowDrop="True" DragEnter="PictureBox_DragEnter" Drop="PictureBox_Drop" /> private void PictureBox_Dra...

C#/WPF: How to find the closest line breaks from the selection of a TextBox

I have a TextBox txtEditor. I want to find the nearest line breaks and select it Example 1: With "no selection" suppose the selection/cursor is * this is the 1st line of text this is *the 2nd line of text this is the 3rd line of text I want to extend the selection such that the selection is now this is the 1st line of text *this i...