# C1.WPF.LiveLinq.WpfExtensions.AsLive

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_WPF_LiveLinq_WpfExtensions_AsLive_" data-uid="C1.WPF.LiveLinq.WpfExtensions.AsLive*">AsLive Method
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_WPF_LiveLinq_WpfExtensions_AsLive_" data-uid="C1.WPF.LiveLinq.WpfExtensions.AsLive*"></a>
<h4 id="C1_WPF_LiveLinq_WpfExtensions_AsLive__1_System_Collections_Specialized_INotifyCollectionChanged_" data-uid="C1.WPF.LiveLinq.WpfExtensions.AsLive``1(System.Collections.Specialized.INotifyCollectionChanged)">AsLive&lt;T&gt;(INotifyCollectionChanged)</h4>
<div class="markdown level1 summary"><p>Creates a view based on the specified <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.specialized.inotifycollectionchanged">INotifyCollectionChanged</a> data source.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static View&lt;T&gt; AsLive&lt;T&gt;(this INotifyCollectionChanged source)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function AsLive(Of T)(source As INotifyCollectionChanged) As View(Of T)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.specialized.inotifycollectionchanged">INotifyCollectionChanged</a></td>
      <td><span class="parametername">source</span></td>
      <td><p>The <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.specialized.inotifycollectionchanged">INotifyCollectionChanged</a> data source to expose as a view.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.LiveLinq.LiveViews.View-1.html">View</a>&lt;T&gt;</td>
      <td><p>A view that contains the same elements as the <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.specialized.inotifycollectionchanged">INotifyCollectionChanged</a> data source.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="typeParameters">Type Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><span class="parametername">T</span></td>
      <td><p>The type of the elements in the view.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_WPF_LiveLinq_WpfExtensions_AsLive__1_System_Collections_Specialized_INotifyCollectionChanged__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>Use this method to build views from existing data sources implementing <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.specialized.inotifycollectionchanged">INotifyCollectionChanged</a>.
The element type of this data source must implement <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.componentmodel.inotifypropertychanged">INotifyPropertyChanged</a>,
see <span style="C1H Jump">Using the built-in collection class IndexedCollection(T) (LiveLinq to Objects)|tag=Using_the_built_in_collection_class_IndexedCollectionT_LiveLinq_to_Objects</span>.</p>
<p>The resulting view may have its elements ordered differently than they are ordered in the <i>source</i>.
Correspondingly, views built on this resulting view (for example, if you filter it with <b>Where</b>) will not preserve the source order either.
If you need to preserve the source order, consider using the other <b>AsLive</b> overload where 
you can specify to what extent you need the order to be preserved.</p>
</div>


<a id="C1_WPF_LiveLinq_WpfExtensions_AsLive_" data-uid="C1.WPF.LiveLinq.WpfExtensions.AsLive*"></a>
<h4 id="C1_WPF_LiveLinq_WpfExtensions_AsLive__1_System_Collections_Specialized_INotifyCollectionChanged_C1_LiveLinq_LiveViews_ViewOrder_" data-uid="C1.WPF.LiveLinq.WpfExtensions.AsLive``1(System.Collections.Specialized.INotifyCollectionChanged,C1.LiveLinq.LiveViews.ViewOrder)">AsLive&lt;T&gt;(INotifyCollectionChanged, ViewOrder)</h4>
<div class="markdown level1 summary"><p>Creates a view based on the specified <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.specialized.inotifycollectionchanged">INotifyCollectionChanged</a> data source.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static View&lt;T&gt; AsLive&lt;T&gt;(this INotifyCollectionChanged source, ViewOrder order)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function AsLive(Of T)(source As INotifyCollectionChanged, order As ViewOrder) As View(Of T)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.specialized.inotifycollectionchanged">INotifyCollectionChanged</a></td>
      <td><span class="parametername">source</span></td>
      <td><p>The <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.specialized.inotifycollectionchanged">INotifyCollectionChanged</a> data source to expose as a view.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.LiveLinq.LiveViews.ViewOrder.html">ViewOrder</a></td>
      <td><span class="parametername">order</span></td>
      <td><p>Specifies whether to preserve source item order.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.LiveLinq.LiveViews.View-1.html">View</a>&lt;T&gt;</td>
      <td><p>A view that contains the same elements as the <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.specialized.inotifycollectionchanged">INotifyCollectionChanged</a> data source.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="typeParameters">Type Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><span class="parametername">T</span></td>
      <td><p>The type of the elements in the view.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 id="C1_WPF_LiveLinq_WpfExtensions_AsLive__1_System_Collections_Specialized_INotifyCollectionChanged_C1_LiveLinq_LiveViews_ViewOrder__remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>Use this method to build views from existing data sources implementing <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.specialized.inotifycollectionchanged">INotifyCollectionChanged</a>.
The element type of this data source must implement <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.componentmodel.inotifypropertychanged">INotifyPropertyChanged</a>,
see <span style="C1H Jump">Using the built-in collection class IndexedCollection(T) (LiveLinq to Objects)|tag=Using_the_built_in_collection_class_IndexedCollectionT_LiveLinq_to_Objects</span>.</p>
<p>If the <i>order</i> parameter specifies preserving item order, the order of items in the source is preserved,
at a certain performance cost, in the resulting view and in views based on it (for example, if you filter it with <b>Where</b>).</p>
<p>Note that <b>Join</b> does not preserve source order. If you need to order a join result, use <b>OrderBy</b> after <b>Join</b>.</p>
</div>


<a id="C1_WPF_LiveLinq_WpfExtensions_AsLive_" data-uid="C1.WPF.LiveLinq.WpfExtensions.AsLive*"></a>
<h4 id="C1_WPF_LiveLinq_WpfExtensions_AsLive__1_System_Collections_ObjectModel_ObservableCollection___0__" data-uid="C1.WPF.LiveLinq.WpfExtensions.AsLive``1(System.Collections.ObjectModel.ObservableCollection{``0})">AsLive&lt;T&gt;(ObservableCollection&lt;T&gt;)</h4>
<div class="markdown level1 summary"><p>A typed specialization of the <a class="xref" href="C1.WPF.LiveLinq.WpfExtensions.AsLive.html#C1_WPF_LiveLinq_WpfExtensions_AsLive__1_System_Collections_Specialized_INotifyCollectionChanged_">AsLive&lt;T&gt;(INotifyCollectionChanged)</a> method.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static View&lt;T&gt; AsLive&lt;T&gt;(this ObservableCollection&lt;T&gt; source)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function AsLive(Of T)(source As ObservableCollection(Of T)) As View(Of T)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.objectmodel.observablecollection-1">ObservableCollection</a>&lt;T&gt;</td>
      <td><span class="parametername">source</span></td>
      <td><p>The <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.objectmodel.observablecollection-1">ObservableCollection&lt;T&gt;</a> to expose as a view.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.LiveLinq.LiveViews.View-1.html">View</a>&lt;T&gt;</td>
      <td><p>A view that contains the same elements as the <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.objectmodel.observablecollection-1">ObservableCollection&lt;T&gt;</a>.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="typeParameters">Type Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><span class="parametername">T</span></td>
      <td><p>The type of the elements in the view.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_WPF_LiveLinq_WpfExtensions_AsLive_" data-uid="C1.WPF.LiveLinq.WpfExtensions.AsLive*"></a>
<h4 id="C1_WPF_LiveLinq_WpfExtensions_AsLive__1_System_Collections_ObjectModel_ObservableCollection___0__C1_LiveLinq_LiveViews_ViewOrder_" data-uid="C1.WPF.LiveLinq.WpfExtensions.AsLive``1(System.Collections.ObjectModel.ObservableCollection{``0},C1.LiveLinq.LiveViews.ViewOrder)">AsLive&lt;T&gt;(ObservableCollection&lt;T&gt;, ViewOrder)</h4>
<div class="markdown level1 summary"><p>A typed specialization of the <a class="xref" href="C1.WPF.LiveLinq.WpfExtensions.AsLive.html#C1_WPF_LiveLinq_WpfExtensions_AsLive__1_System_Collections_Specialized_INotifyCollectionChanged_C1_LiveLinq_LiveViews_ViewOrder_">AsLive&lt;T&gt;(INotifyCollectionChanged, ViewOrder)</a> method.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static View&lt;T&gt; AsLive&lt;T&gt;(this ObservableCollection&lt;T&gt; source, ViewOrder order)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function AsLive(Of T)(source As ObservableCollection(Of T), order As ViewOrder) As View(Of T)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.objectmodel.observablecollection-1">ObservableCollection</a>&lt;T&gt;</td>
      <td><span class="parametername">source</span></td>
      <td><p>The <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.objectmodel.observablecollection-1">ObservableCollection&lt;T&gt;</a> to expose as a view.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.LiveLinq.LiveViews.ViewOrder.html">ViewOrder</a></td>
      <td><span class="parametername">order</span></td>
      <td><p>Specifies whether to preserve source item order.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.LiveLinq.LiveViews.View-1.html">View</a>&lt;T&gt;</td>
      <td><p>A view that contains the same elements as the <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.objectmodel.observablecollection-1">ObservableCollection&lt;T&gt;</a>.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="typeParameters">Type Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><span class="parametername">T</span></td>
      <td><p>The type of the elements in the view.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_WPF_LiveLinq_WpfExtensions_AsLive_" data-uid="C1.WPF.LiveLinq.WpfExtensions.AsLive*"></a>
<h4 id="C1_WPF_LiveLinq_WpfExtensions_AsLive__1_System_Collections_ObjectModel_ReadOnlyObservableCollection___0__" data-uid="C1.WPF.LiveLinq.WpfExtensions.AsLive``1(System.Collections.ObjectModel.ReadOnlyObservableCollection{``0})">AsLive&lt;T&gt;(ReadOnlyObservableCollection&lt;T&gt;)</h4>
<div class="markdown level1 summary"><p>A typed specialization of the <a class="xref" href="C1.WPF.LiveLinq.WpfExtensions.AsLive.html#C1_WPF_LiveLinq_WpfExtensions_AsLive__1_System_Collections_Specialized_INotifyCollectionChanged_">AsLive&lt;T&gt;(INotifyCollectionChanged)</a> method.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static View&lt;T&gt; AsLive&lt;T&gt;(this ReadOnlyObservableCollection&lt;T&gt; source)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function AsLive(Of T)(source As ReadOnlyObservableCollection(Of T)) As View(Of T)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.objectmodel.readonlyobservablecollection-1">ReadOnlyObservableCollection</a>&lt;T&gt;</td>
      <td><span class="parametername">source</span></td>
      <td><p>The <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.objectmodel.readonlyobservablecollection-1">ReadOnlyObservableCollection&lt;T&gt;</a> to expose as a view.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.LiveLinq.LiveViews.View-1.html">View</a>&lt;T&gt;</td>
      <td><p>A view that contains the same elements as the <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.objectmodel.readonlyobservablecollection-1">ReadOnlyObservableCollection&lt;T&gt;</a>.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="typeParameters">Type Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><span class="parametername">T</span></td>
      <td><p>The type of the elements in the view.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_WPF_LiveLinq_WpfExtensions_AsLive_" data-uid="C1.WPF.LiveLinq.WpfExtensions.AsLive*"></a>
<h4 id="C1_WPF_LiveLinq_WpfExtensions_AsLive__1_System_Collections_ObjectModel_ReadOnlyObservableCollection___0__C1_LiveLinq_LiveViews_ViewOrder_" data-uid="C1.WPF.LiveLinq.WpfExtensions.AsLive``1(System.Collections.ObjectModel.ReadOnlyObservableCollection{``0},C1.LiveLinq.LiveViews.ViewOrder)">AsLive&lt;T&gt;(ReadOnlyObservableCollection&lt;T&gt;, ViewOrder)</h4>
<div class="markdown level1 summary"><p>A typed specialization of the <a class="xref" href="C1.WPF.LiveLinq.WpfExtensions.AsLive.html#C1_WPF_LiveLinq_WpfExtensions_AsLive__1_System_Collections_Specialized_INotifyCollectionChanged_C1_LiveLinq_LiveViews_ViewOrder_">AsLive&lt;T&gt;(INotifyCollectionChanged, ViewOrder)</a> method.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public static View&lt;T&gt; AsLive&lt;T&gt;(this ReadOnlyObservableCollection&lt;T&gt; source, ViewOrder order)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Shared Function AsLive(Of T)(source As ReadOnlyObservableCollection(Of T), order As ViewOrder) As View(Of T)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.objectmodel.readonlyobservablecollection-1">ReadOnlyObservableCollection</a>&lt;T&gt;</td>
      <td><span class="parametername">source</span></td>
      <td><p>The <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.objectmodel.readonlyobservablecollection-1">ReadOnlyObservableCollection&lt;T&gt;</a> to expose as a view.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="C1.LiveLinq.LiveViews.ViewOrder.html">ViewOrder</a></td>
      <td><span class="parametername">order</span></td>
      <td><p>Specifies whether to preserve source item order.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.LiveLinq.LiveViews.View-1.html">View</a>&lt;T&gt;</td>
      <td><p>A view that contains the same elements as the <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.objectmodel.readonlyobservablecollection-1">ReadOnlyObservableCollection&lt;T&gt;</a>.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="typeParameters">Type Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><span class="parametername">T</span></td>
      <td><p>The type of the elements in the view.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
