Search Results

Search found 13 results on 1 pages for 'imultivalueconverter'.

Page 1/1 | 1 

  • Access to bound data in IMultiValueConverter.ConvertBack() in C#/WPF

    - by absence
    I have a problem with a multibinding: <Canvas> <local:SPoint x:Name="sp" Width="10" Height="10"> <Canvas.Left><!-- irrelevant binding here --></Canvas.Left> <Canvas.Top> <MultiBinding Converter="{StaticResource myConverter}" Mode="TwoWay"> <Binding ElementName="cp1" Path="(Canvas.Top)"/> <Binding ElementName="cp1" Path="Height"/> <Binding ElementName="cp2" Path="(Canvas.Top)"/> <Binding ElementName="cp2" Path="Height"/> <Binding ElementName="sp" Path="Height"/> <Binding ElementName="sp" Path="Slope" Mode="TwoWay"/> </MultiBinding> </Canvas.Top> </local:SPoint> <local:CPoint x:Name="cp1" Width="10" Height="10" Canvas.Left="20" Canvas.Top="150"/> <local:CPoint x:Name="cp2" Width="10" Height="10" Canvas.Left="100" Canvas.Top="20"/> </Canvas> In order to calculate the Canvas.Top value, myConverter needs all the bound values. This works great in Convert(). Going the other way, myConverter should ideally calculate the Slope value (Binding.DoNothing for the rest), but it needs the other values in addition to the Canvas.Top one passed to ConvertBack(). What is the right way to solve this? I have tried making the binding OneWay and create an additional multibinding for local:SPoint.Slope, but that causes infinite recursion and stack overflow. I was thinking the ConverterParameter could be used, but it seems like it's not possible to bind to it.

    Read the article

  • Why does my IMultiBindingConverter get an array of strings when used to set TextBox.Text?

    - by mcohen75
    Hi- I'm trying to use a MultiBinding with a converter where the child elements also have a converter. The XAML looks like so: <TextBlock> <TextBlock.Text> <MultiBinding Converter="{StaticResource localizedMessageConverter}" ConverterParameter="{x:Static res:Resources.RecordsFound}" > <Binding Converter="{StaticResource localizedMessageParameterConverter}" ConverterParameter="ALIAS" Path="Alias" Mode="OneWay" /> <Binding Converter="{StaticResource localizedMessageParameterConverter}" ConverterParameter="COUNT" Path="Count" Mode="OneWay" /> </MultiBinding> </TextBlock.Text> The problem I'm facing here is, whenever this is used with a TextBlock to specify the Text property, my IMultiValueConverter implementation gets an object collection of strings instead of the class returned by the IValueConverter. It seems that the ToString() method is called on the result of the inner converter and passed to the IMultiValueConverter. If used to specify the Content property of Label, all is well. It seems to me that the framework is assuming that the return type will be string, but why? I can see this for the MultiBinding since it should yield a result that is compatible with TextBlock.Text, but why would this also be the case for the Bindings inside a MultiBinding? If I remove the converter from the inner Binding elements, the native types are returned. In my case string and int.

    Read the article

  • Why do I get a DependencyProperty.UnsetValue when converting a value in a MultiBinding?

    - by eskerber
    I have an extremely simple IMultiValueConverter that simply OR's two values. In the example below, I want to invert the first value using an equally simple boolean inverter. <MultiBinding Converter="{StaticResource multiBoolToVis}"> <Binding Path="ConditionA" Converter="{StaticResource boolInverter}"/> <Binding Path="ConditionB"/> </MultiBinding> public class BoolInverterConverter : IValueConverter { #region IValueConverter Members public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { if (value is bool) { return !((bool)value); } return null; } public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { throw new NotImplementedException(); } #endregion } When I include the boolInverter, the first value in the MultiValueConverter becomes a "DependencyProperty.UnsetValue". There are no problems when I do not use the converter (other than not the logic I am aiming for, of course). Am I missing something? Stepping through the debugger shows that the InverseBoolConverter is properly inverting the value I pass it, but that value is then not being 'sent' to the MultiValueConverter.

    Read the article

  • Need additional help with binding multiple CommandParameters using MultiBinding

    - by Dave
    I need to have a command handler for a ToggleButton that can take multiple parameters, namely the IsChecked property of said ToggleButton, along with a constant value, which could be a string, byte, int... doesn't matter. I found this great question on SO and followed the answer's link and read up on MultiBinding and IMultiValueConverter. It went really smoothly until I had to write the MultiBinding, when I realized that I also need to pass a constant value and couldn't do something like <Binding Value="1" /> I then came across another similar question that Kent Boogaart answered, and then I started to think about ways that I could get around this. One possible way is to not use MVVM and simply add the Tag property to my ToggleButton, in which case my MultiBinding would look like this: <MultiBinding Converter="{StaticResource MyConverter}"> <MultiBinding.Bindings> <Binding Path="IsChecked" /> <Binding Path="Tag" /> </MultiBinding.Bindings> </MultiBinding> Kent had made a comment along the lines of, "if you're using MVVM you should be able to get around this issue". However, I'm not sure that's an option for me, even though I have adopted MVVM as my WPF pattern of necessity choice. The reason why I say this is that I have wayyyy more than one ToggleButton in the UserControl, and each of the ToggleButtons' Commands need to call the same function. But since they are ToggleButtons, I can't use the property bound to IsChecked in the ViewModel, because I don't know which one was last clicked. I suppose I could add another private property to keep track of this, but it seems a little silly. As far as the constant goes, I could probably get rid of this if I did the tracking idea, but not sure of any other way to get around it. Does anyone have good suggestions for me here? :) EDIT -- ok, so I need to update my bindings, which still don't work quite right: <ToggleButton Tag="1" Command="{Binding MyCommand}" Style="{StaticResource PassFailToggleButtonStyle}" HorizontalContentAlignment="Center" Background="Transparent" BorderBrush="Transparent" BorderThickness="0"> <ToggleButton.CommandParameter> <MultiBinding Converter="{StaticResource MyConverter}"> <MultiBinding.Bindings> <Binding Path="IsChecked" RelativeSource="{RelativeSource Mode=Self}" /> <Binding Path="Tag" RelativeSource="{RelativeSource Mode=Self}" /> </MultiBinding.Bindings> </MultiBinding> </ToggleButton.CommandParameter> </ToggleButton> IsChecked was working, but not Tag. I just realized that Tag is a string... duh. It's working now! The key was to use a RelativeSource of Self.

    Read the article

  • C# WPF: Combobox isn't jumping down the list as I type when I use a multiconvert on it.

    - by michael paul
    Basically, I have a combobox that is built by doing multibinding (multiconverter) for the memberdisplaypath. The problem is if the combobox is selected and I start typing, it doesn't jump down the list. Doesn't it go by what's displayed in the combobox for typing? That is, if the combobox is setup like so: //value/display (please disregard how weird the numbering is...) //ref - the value is built upon an observablecollection of a class. ref / "" ref / "10 - Very much agree." ref / "15 - Somewhat agree." ref / "19 - No weight." ref / "23 - Somwhat disagree." ref / "33 - Very much disagree." If the user presses the "1" key it should jump to "10 - Very much agree." But, instead it just sits there...

    Read the article

  • Change made in the Converter will notify the change in the bound property?

    - by Kishore Kumar
    I have two property FirstName and LastName and bound to a textblock using Multibinidng and converter to display the FullName as FirstName + Last Name. FirstName="Kishore" LastName="Kumar" In the Converter I changed the LastName as "Changed Text" values[1] = "Changed Text"; After executing the Converter my TextBlock will show "Kishore Changed Text" but Dependency property LastName is still have the last value "Kumar". Why I am not getting the "Changed Text" value in the LastName property after the execution?. Will the change made at converter will notify the bound property? <Window.Resources> <local:NameConverter x:Key="NameConverter"></local:NameConverter> </Window.Resources> <Grid> <TextBlock> <TextBlock.Text> <MultiBinding Converter="{StaticResource NameConverter}"> <Binding Path="FirstName"></Binding> <Binding Path="LastName"></Binding> </MultiBinding> </TextBlock.Text> </TextBlock> </Grid> Converter: public class NameConverter:IMultiValueConverter { #region IMultiValueConverter Members public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture) { values[1] = "Changed Text"; return values[0].ToString() + " " + values[1].ToString(); } public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture) { throw new NotImplementedException(); } #endregion }

    Read the article

  • Give WPF design mode default objects

    - by Janko R
    In my application I have <Rectangle.Margin> <MultiBinding Converter="{StaticResource XYPosToThicknessConverter}"> <Binding Path="XPos"/> <Binding Path="YPos"/> </MultiBinding> </Rectangle.Margin> The Data Context is set during runtime. The application works, but the design window in VS does not show a preview but System.InvalidCastException. That’s why I added a default object in the XYPosToThicknessConverter which is ugly. class XYPosToThicknessConverter : IMultiValueConverter { public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture) { // stupid check to give the design window its default object. if (!(values[0] is IConvertible)) return new System.Windows.Thickness(3, 3, 0, 0); // useful code and exception throwing starts here // ... } } My Questions: What does VS/the process that builds the design window pass to XYPosToThicknessConverter and what is way to find it out by myself. How do I change my XAML code, so that the design window gets its default object and is this the best way to handle this problem? I’m using VS2010RC with Net4.0

    Read the article

  • Is there an MVVM-friendly way to swap views without value converters firing unnecessarily?

    - by DanM
    I thought what I was doing was right out of the Josh Smith MVVM handbook, but I seem to be having a lot of problems with value converters firing when no data in the view-model has changed. So, I have a ContentControl defined in XAML like this: <ContentControl Grid.Row="0" Content="{Binding CurrentViewModel}" /> The Window containing this ContentControl references a resource dictionary that looks something like this: <ResourceDictionary ...> <DataTemplate DataType="{x:Type lib_vm:SetupPanelViewModel}"> <lib_v:SetupPanel /> </DataTemplate> <DataTemplate DataType="{x:Type lib_vm:InstructionsPanelViewModel}"> <lib_v:InstructionsPanel /> </DataTemplate> </ResourceDictionary> So, basically, the two data templates specify which view to show with which view-model. This switches the views as expected whenever the CurrentViewModel property on my window's view-model changes, but it also seems to cause value converters on the views to fire even when no data has changed. It's a particular problem with IMultiValueConverter classes, because the values in the value array get set to DependencyProperty.UnsetValue, which causes exceptions unless I specifically check for that. But I'm getting other weird side effects too. This has me wondering if I shouldn't just do everything manually, like this: Instantiate each view. Set the DataContext of each view to the appropriate view-model. Give the ContentControl a name and make it public. Handle the PropertyChanged event for the window. In the event handler, manually set the Content property of the ContentControl to the appropriate view, based the CurrentViewModel (using if statements). This seems to work, but it also seems very inelegant. I'm hoping there's a better way. Could you please advise me the best way to handle view switching so that value converters don't fire unnecessarily?

    Read the article

  • How do I stop ValueConverters from firing when swapping the content of a ContentControl

    - by DanM
    I thought what I was doing was right out of the Josh Smith MVVM handbook, but I seem to be having a lot of problems with value converters firing when no data in the view-model has changed. So, I have a ContentControl defined in XAML like this: <ContentControl Grid.Row="0" Content="{Binding CurrentViewModel}" /> The Window containing this ContentControl references a resource dictionary that looks something like this: <ResourceDictionary ...> <DataTemplate DataType="{x:Type lib_vm:SetupPanelViewModel}"> <lib_v:SetupPanel /> </DataTemplate> <DataTemplate DataType="{x:Type lib_vm:InstructionsPanelViewModel}"> <lib_v:InstructionsPanel /> </DataTemplate> </ResourceDictionary> So, basically, the two data templates specify which view to show with which view-model. This switches the views as expected whenever the CurrentViewModel property on my window's view-model changes, but it also seems to cause value converters on the views to fire even when no data has changed. It's a particular problem with IMultiValueConverter classes, because the values in the value array get set to DependencyProperty.UnsetValue, which causes exceptions unless I specifically check for that. But I'm getting other weird side effects too. This has me wondering if I shouldn't just do everything manually, like this: Instantiate each view. Set the DataContext of each view to the appropriate view-model. Give the ContentControl a name and make it public. Handle the PropertyChanged event for the window. In the event handler, manually set the Content property of the ContentControl to the appropriate view, based the CurrentViewModel (using if statements). This seems to work, but it also seems very inelegant. I'm hoping there's a better way. Could you please advise me the best way to handle view switching so that value converters don't fire unnecessarily?

    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

  • Filtering in a HierarchicalDataTemplate via MarkupExtension?

    - by Dan Bryant
    I'm trying to create a MarkupExtension to allow filtering of items in an ItemsSource of a HierarchicalDataTemplate. In particular, I'd like to be able to supply a method name that will be executed on the DataContext in order to perform the filtering. The usage syntax I'm after looks like this: <HierarchicalDataTemplate DataType="{x:Type src:DeviceBindingViewModel}" ItemsSource="{Utilities:FilterCollection {Binding Definition.Entries}, MethodName=FilterEntries}"> <StackPanel Orientation="Horizontal"> <Image Source="{StaticResource BindingImage}" Width="24" Height="24" Margin="3"/> <TextBlock Text="{Binding DisplayName}" FontSize="12" VerticalAlignment="Center"/> </StackPanel> </HierarchicalDataTemplate> My code for the custom MarkupExtension looks like this: public sealed class FilterCollectionExtension : MarkupExtension { private readonly MultiBinding _binding; private Predicate<Object> _filterMethod; public string MethodName { get; set; } public FilterCollectionExtension(Binding binding) { _binding = new MultiBinding(); _binding.Bindings.Add(binding); //We package a reference to the DataContext with the binding so that the Converter has access to it var selfBinding = new Binding {RelativeSource = RelativeSource.Self}; _binding.Bindings.Add(selfBinding); _binding.Converter = new InternalConverter(this); } public FilterCollectionExtension(Binding binding, string methodName) : this(binding) { MethodName = methodName; } public override object ProvideValue(IServiceProvider serviceProvider) { return _binding; } private bool FilterInternal(Object dataContext, Object value) { //Filtering is only applicable if a DataContext is defined if (dataContext != null) { if (_filterMethod == null) { var type = dataContext.GetType(); var method = type.GetMethod(MethodName, new[] { typeof(Object) }); if (method == null || method.ReturnType != typeof(bool)) throw new InvalidOperationException("Could not locate a filter predicate named " + MethodName + " on the DataContext"); _filterMethod = (Predicate<Object>)Delegate.CreateDelegate(typeof(Predicate<Object>), dataContext, method); } else { if (_filterMethod.Target != dataContext) { _filterMethod = (Predicate<Object>) Delegate.CreateDelegate(typeof (Predicate<Object>), dataContext, _filterMethod.Method); } } if (_filterMethod != null) return _filterMethod(value); } //If no filtering resolved, just allow all elements return true; } private class InternalConverter : IMultiValueConverter { private readonly FilterCollectionExtension _owner; public InternalConverter(FilterCollectionExtension owner) { _owner = owner; } public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture) { var enumerable = values[0]; var targetElement = (FrameworkElement)values[1]; var view = CollectionViewSource.GetDefaultView(enumerable); view.Filter = item => _owner.FilterInternal(targetElement.DataContext, item); return view; } public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture) { throw new NotSupportedException("Cannot convert back"); } } } I can see that the extension is instantiated and I can see it return the MultiBinding that is used by the Template. I also see the call to the InternalConverter.Convert method, which sees the expected parameters (I see the collection provided by the nested {Binding}) and is successfully able to retrieve the ICollectionView for the incoming collection. The only problem is that FilterInternal never gets called. The template is ultimately being used by a TreeView, if that's relevant. I haven't been able to figure out why the FilterInternal method is not being called and I was hoping somebody might be able to offer some insight.

    Read the article

  • CodePlex Daily Summary for Tuesday, April 10, 2012

    CodePlex Daily Summary for Tuesday, April 10, 2012Popular ReleasesSCCM Client Actions Tool: SCCM Client Actions Tool v1.12: SCCM Client Actions Tool v1.12 is the latest version. It comes with following changes since last version: Improved WMI date conversion to be aware of timezone differences and DST. Fixed new version check. The tool is downloadable as a ZIP file that contains four files: ClientActionsTool.hta – The tool itself. Cmdkey.exe – command line tool for managing cached credentials. This is needed for alternate credentials feature when running the HTA on Windows XP. Cmdkey.exe is natively availab...Dual Browsing: Dual Browser: Please note the following: I setup the address bar temporarily to only accepts http:// .com addresses. Just type in the name of the website excluding: http://, www., and .com; (Ex: for www.youtube.com just type: youtube then click OK). The page splitter can be grabbed by holding down your left mouse button and move left or right. By right clicking on the page background, you can choose to refresh, go back a page and so on. Demo video: http://youtu.be/L7NTFVM3JUYMultiwfn: Multiwfn 2.3.3: Multiwfn 2.3.3Liberty: v3.2.0.1 Release 9th April 2012: Change Log-Fixed -Reach Fixed a bug where the object editor did not work on non-English operating systemsStyleCop+: StyleCop+ 1.8: Built over StyleCop 4.7.17.0 According to http://stylecop.codeplex.com/workitem/7156, it should be the last version which is released without new features and only for compatibility reasons. Do not forget to Unblock the file after downloading (more details) Stay tuned!Path Copy Copy: 10.1: This release addresses the following work items: 11357 11358 11359 This release is a recommended upgrade, especially for users who didn't install the 10.0.1 version.ExtAspNet: ExtAspNet v3.1.3: ExtAspNet - ?? ExtJS ??? ASP.NET 2.0 ???,????? AJAX ?????????? ExtAspNet ????? ExtJS ??? ASP.NET 2.0 ???,????? AJAX ??????????。 ExtAspNet ??????? JavaScript,?? CSS,?? UpdatePanel,?? ViewState,?? WebServices ???????。 ??????: IE 7.0, Firefox 3.6, Chrome 3.0, Opera 10.5, Safari 3.0+ ????:Apache License 2.0 (Apache) ??:http://extasp.net/ ??:http://bbs.extasp.net/ ??:http://extaspnet.codeplex.com/ ??:http://sanshi.cnblogs.com/ ????: +2012-04-08 v3.1.3 -??Language="zh_TW"?JS???BUG(??)。 +?D...Coding4Fun Tools: Coding4Fun.Phone.Toolkit v1.5.5: New Controls ChatBubble ChatBubbleTextBox OpacityToggleButton New Stuff TimeSpan languages added: RU, SK, CS Expose the physics math from TimeSpanPicker Image Stretch now on buttons Bug Fixes Layout fix so RoundToggleButton and RoundButton are exactly the same Fix for ColorPicker when set via code behind ToastPrompt bug fix with OnNavigatedTo Toast now adjusts its layout if the SIP is up Fixed some issues with Expression Blend supportHarness - Internet Explorer Automation: Harness 2.0.3: support the operation fo frameset, frame and iframe Add commands SwitchFrame GetUrl GoBack GoForward Refresh SetTimeout GetTimeout Rename commands GetActiveWindow to GetActiveBrowser SetActiveWindow to SetActiveBrowser FindWindowAll to FindBrowser NewWindow to NewBrowser GetMajorVersion to GetVersionBetter Explorer: Better Explorer 2.0.0.861 Alpha: - fixed new folder button operation not work well in some situations - removed some unnecessary code like subclassing that is not needed anymore - Added option to make Better Exlorer default (at least for WIN+E operations) - Added option to enable file operation replacements (like Terracopy) to work with Better Explorer - Added some basic usability to "Share" button - Other fixesText Designer Outline Text: Version 2 Preview 2: Added Fake 3D demos for C++ MFC, C# Winform and C# WPFLightFarsiDictionary - ??????? ??? ?????/???????: LightFarsiDictionary - v1: LightFarsiDictionary - v1WPF Application Framework (WAF): WPF Application Framework (WAF) 2.5.0.3: Version: 2.5.0.3 (Milestone 3): This release contains the source code of the WPF Application Framework (WAF) and the sample applications. Requirements .NET Framework 4.0 (The package contains a solution file for Visual Studio 2010) The unit test projects require Visual Studio 2010 Professional Changelog Legend: [B] Breaking change; [O] Marked member as obsolete [O] WAF: Mark the StringBuilderExtensions class as obsolete because the AppendInNewLine method can be replaced with string.Jo...GeoMedia PostGIS data server: PostGIS GDO 1.0.1.2: This is a new version of GeoMeda PostGIS data server which supports user rights. It means that only those feature classes, which the current user has rights to select, are visible in GeoMedia. Issues fixed in this release Fixed problem with renaming and deleting feature classes - IMPORTANT! - the gfeatures view must be recreated so that this issue is completely fixed. The attached script "GFeaturesView2.sql" can be used to accomplish this task. Another way is to drop and recreate the metadat...SkyDrive Connector for SharePoint: SkyDrive Connector for SharePoint: Fixed a few bugs pertaining to live authentication Removed dependency on Shared Documents Removed CallBack web part propertyClosedXML - The easy way to OpenXML: ClosedXML 0.65.2: Aside from many bug fixes we now have Conditional Formatting The conditional formatting was sponsored by http://www.bewing.nl (big thanks) New on v0.65.1 Fixed issue when loading conditional formatting with default values for icon sets New on v0.65.2 Fixed issue loading conditional formatting Improved inserts performanceMSBuild Extension Pack: April 2012: Release Blog Post The MSBuild Extension Pack April 2012 release provides a collection of over 435 MSBuild tasks. A high level summary of what the tasks currently cover includes the following: System Items: Active Directory, Certificates, COM+, Console, Date and Time, Drives, Environment Variables, Event Logs, Files and Folders, FTP, GAC, Network, Performance Counters, Registry, Services, Sound Code: Assemblies, AsyncExec, CAB Files, Code Signing, DynamicExecute, File Detokenisation, GUID’...DotNetNuke® Community Edition CMS: 06.01.05: Major Highlights Fixed issue that stopped users from creating vocabularies when the portal ID was not zero Fixed issue that caused modules configured to be displayed on all pages to be added to the wrong container in new pages Fixed page quota restriction issue in the Ribbon Bar Removed restriction that would not allow users to use a dash in page names. Now users can create pages with names like "site-map" Fixed issue that was causing the wrong container to be loaded in modules wh...51Degrees.mobi - Mobile Device Detection and Redirection: 2.1.3.1: One Click Install from NuGet Changes to Version 2.1.3.11. [assembly: AllowPartiallyTrustedCallers] has been added back into the AssemblyInfo.cs file to prevent failures with other assemblies in Medium trust environments. 2. The Lite data embedded into the assembly has been updated to include devices from December 2011. The 42 new RingMark properties will return Unknown if RingMark data is not available. Changes to Version 2.1.2.11Code Changes 1. The project is now licenced under the Mozilla...MVC Controls Toolkit: Mvc Controls Toolkit 2.0.0: Added Support for Mvc4 beta and WebApi The SafeqQuery and HttpSafeQuery IQueryable implementations that works as wrappers aroung any IQueryable to protect it from unwished queries. "Client Side" pager specialized in paging javascript data coming either from a remote data source, or from local data. LinQ like fluent javascript api to build queries either against remote data sources, or against local javascript data, with exactly the same interface. There are 3 different query objects exp...New ProjectsA C++ Websocket Server For realtime interaction with Web clients.: A websocket protocol layer to the Real Time Server library Push Framework. ABS: Assignment 2 of WDT Due date: 20th May 2012C# Garbage Pump: Password Keylogger Evasion: C# DLL for handling password input that is not susceptible to keylogging through a Garbage Pump technique, which pumps random keys, i.e. garbage, out while the user enters in a password. See screenshots for output results.ChangeTrackingDemo: Change Tracking demo application.CRK: My experimental WebsiteDoAnGame3D: d? án game 3dEyes On Train: The Eyes on Train is the application that can take the picture from multiple cameras and then it can monitor where the mini train it's.FRC Robot Simulator: A robot simulator that uses .NET and XNA technology at its core. Although targeted for FRC simulation, it can THEORETICALLY be used for any WPILib projects.GestorFinanceiro: GestorFinanceiro Exemplo de projeto baseado no padrão: Domain Driven Design. Desenvolvido em c#G-Labs: This project will be used to store "labs" projects from our group.HPCloud API: This project allows developers to work with HP's new Openstack based Storage and Compute infrastructures.indexeddb-feed-reader: Feed reader application using Indexed Database APIIT Trick Repository: This project is the source control for all projects, samples and tutorials posted at mshamkhani.blogspot.comJasLib: General-purpose power toolkit for the .NET Framework on desktop Windows computers.karolocommunicator: mój komunikatorekLan Community: Aplikacja sluzaca do komunikowania sie i monitorowania sieci lokalnej.LastFmReminder: (Work in progress) This Silverlight application uses the Last.fm API to get the names of all the artists you haven't listened to since a specified date. The working application is at http://lastfmreminder.atw.hu/ .linewatchSimple: linewatchSimpleLiuyi.network | Liuyi - [Liuyi.network_8.0] Liuyi.network_2.0 Liuyi.network_1.0: Liuyi.network | Liuyi - Liuyi.network_8.0 Liuyi.network_7.0 Liuyi.network_6.0 Liuyi.network_5.0 Liuyi.network_4.0 Liuyi.network_3.0 Liuyi.network_2.0 Liuyi.network_1.0 liuyi .net C# aspx network liuyi.network liuyi.aspx liuyi.C# liuyi.netMogutaro eats files!: Hobby application using HTML5 and File API. You can drag and drop files into the whale (named Mogutaro) 's mouth. moogle: Moogle is an android application developed using Mono as part of a project for a communications class at IIT. The class, COM 380, dealt with the topic of "Humanizing Technology". The application pseudo (but working) app for managing prescription information. In this way, it is mainly meant as a sample android application developed using .NET. For additional information about this application and group effort that led to its creation, please refer to the documentation of this site.ms2011_win32_tcs: ??????ncontrols: LIbrary of ASP.NET controls that works with NHibernateNetGL: Idea is to create a .Net library allows to use OpenGL in managed code. It is in early state, but shaders are working and no garbage collections occur.Orchard Portlets: Building on the work of the Orchard Widgets module, Orchard Portlets allows users to drag the widgets around the Ui without being in the admin screensProject Detroit: OBD-II Manager: A library to parse OBD-II data coming from a vehicle using an ELM323/327 compatible OBD to USB/serial cable. The solution also includes the WPF Instrument Cluster application that was used in the Project Detroit car!Silverlight 5 MarkupExtensions and Other Utilities: This project contains a replacement for certain WPF functionalities in SL5. Currently contains TypeExtension, StaticExtension, MultiBinding (and IMultiValueConverter), ObjectDataProvider, ArrayExtension Currently under development is an ExpressionParser and related converters.SjASMPlusUnreal: SjASM Plus Unreal at last!Source Code: Source CodeSpecflow Example: Some examples with BDD tool SpecflowSuperSocket ClientEngine: Socket client framework wrapping async data receiving, sending and error handlingTestAppMc: TestAppMcTestBBN: Test ProjectTrabalho News FPU: servidor de serviçosVisual FoxPro Professional 2012: Visual FoxPro Professional is a project to extentd Visual FoxPro editor capabilities. This is based on Scintilla Editor control. websocket-japanese-chalkboard: Multi user chalkboard using WebSocketWholemy.MonolithDBF: Monolith is Data Base Format on Double Tree Node, once Node Header for all data in file, opened direct access in file by offset node. First prototype dated on 2007 year.Zinc: Zinc is a utility library for ASP.NET web forms development. It has support for: - utility methods for working easier with controls - CSV exports - HttpModules for dealing with caching and path based rights. - custom controls This library runs on .NET 2.0 and i would like to kee

    Read the article

  • Using Image Source with big images in WPF

    - by xyzzer
    I am working on an application that allows users to manipulate multiple images by using ItemsControl. I started running some tests and found that the app has problems displaying some big images - ie. it did not work with the high resolution (21600x10800), 20MB images from http://earthobservatory.nasa.gov/Features/BlueMarble/BlueMarble_monthlies.php, though it displays the 6200x6200, 60MB Hubble telescope image from http://zebu.uoregon.edu/hudf/hudf.jpg just fine. The original solution just specified an Image control with a Source property pointing at a file on a disk (through a binding). With the Blue Marble file - the image would just not show up. Now this could be just a bug hidden somewhere deep in the funky MVVM + XAML implementation - the visual tree displayed by Snoop goes like: Window/Border/AdornerDecorator/ContentPresenter/Grid/Canvas/UserControl/Border/ContentPresenter/Grid/Grid/Grid/Grid/Border/Grid/ContentPresenter/UserControl/UserControl/Border/ContentPresenter/Grid/Grid/Grid/Grid/Viewbox/ContainerVisual/UserControl/Border/ContentPresenter/Grid/Grid/ItemsControl/Border/ItemsPresenter/Canvas/ContentPresenter/Grid/Grid/ContentPresenter/Image... Now debug this! WPF can be crazy like that... Anyway, it turned out that if I create a simple WPF application - the images load just fine. I tried finding out the root cause, but I don't want to spend weeks on it. I figured the right thing to do might be to use a converter to scale the images down - this is what I have done: ImagePath = @"F:\Astronomical\world.200402.3x21600x10800.jpg"; TargetWidth = 2800; TargetHeight = 1866; and <Image> <Image.Source> <MultiBinding Converter="{StaticResource imageResizingConverter}"> <MultiBinding.Bindings> <Binding Path="ImagePath"/> <Binding RelativeSource="{RelativeSource Self}" /> <Binding Path="TargetWidth"/> <Binding Path="TargetHeight"/> </MultiBinding.Bindings> </MultiBinding> </Image.Source> </Image> and public class ImageResizingConverter : MarkupExtension, IMultiValueConverter { public Image TargetImage { get; set; } public string SourcePath { get; set; } public int DecodeWidth { get; set; } public int DecodeHeight { get; set; } public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) { this.SourcePath = values[0].ToString(); this.TargetImage = (Image)values[1]; this.DecodeWidth = (int)values[2]; this.DecodeHeight = (int)values[3]; return DecodeImage(); } private BitmapImage DecodeImage() { BitmapImage bi = new BitmapImage(); bi.BeginInit(); bi.DecodePixelWidth = (int)DecodeWidth; bi.DecodePixelHeight = (int)DecodeHeight; bi.UriSource = new Uri(SourcePath); bi.EndInit(); return bi; } public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) { throw new Exception("The method or operation is not implemented."); } public override object ProvideValue(IServiceProvider serviceProvider) { return this; } } Now this works fine, except for one "little" problem. When you just specify a file path in Image.Source - the application actually uses less memory and works faster than if you use BitmapImage.DecodePixelWidth. Plus with Image.Source if you have multiple Image controls that point to the same image - they only use as much memory as if only one image was loaded. With the BitmapImage.DecodePixelWidth solution - each additional Image control uses more memory and each of them uses more than when just specifying Image.Source. Perhaps WPF somehow caches these images in compressed form while if you specify the decoded dimensions - it feels like you get an uncompressed image in memory, plus it takes 6 times the time (perhaps without it the scaling is done on the GPU?), plus it feels like the original high resolution image also gets loaded and takes up space. If I just scale the image down, save it to a temporary file and then use Image.Source to point at the file - it will probably work, but it will be pretty slow and it will require handling cleanup of the temporary file. If I could detect an image that does not get loaded properly - maybe I could only scale it down if I need to, but Image.ImageFailed never gets triggered. Maybe it has something to do with the video memory and this app just using more of it with the deep visual tree, opacity masks etc. Actual question: How can I load big images as quickly as Image.Source option does it, without using more memory for additional copies and additional memory for the scaled down image if I only need them at a certain resolution lower than original? Also, I don't want to keep them in memory if no Image control is using them anymore.

    Read the article

1